diff options
Diffstat (limited to 'src/components/application_manager/include/application_manager/hmi_capabilities.h')
-rw-r--r-- | src/components/application_manager/include/application_manager/hmi_capabilities.h | 204 |
1 files changed, 106 insertions, 98 deletions
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities.h b/src/components/application_manager/include/application_manager/hmi_capabilities.h index 277455ff4e..f94c8125c8 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2016, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY 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_ @@ -37,28 +37,30 @@ #include "interfaces/MOBILE_API.h" #include "json/json.h" #include "utils/macro.h" +#include "application_manager/hmi_language_handler.h" namespace NsSmartDeviceLink { namespace NsSmartObjects { class SmartObject; } } +namespace resumption { +class LastState; +} namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; namespace application_manager { -class ApplicationManagerImpl; +class ApplicationManager; class HMICapabilities { - public: - /* * @ Class constructor * * @param app_mngr Application manager pointer */ - explicit HMICapabilities(ApplicationManagerImpl* const app_mngr); + explicit HMICapabilities(ApplicationManager& app_mngr); /* * @brief Class destructor @@ -121,8 +123,7 @@ class HMICapabilities { * * @return Currently active UI language */ - inline const hmi_apis::Common_Language::eType& - active_ui_language() const; + const hmi_apis::Common_Language::eType active_ui_language() const; /* * @brief Sets currently active UI language @@ -136,8 +137,7 @@ class HMICapabilities { * * @return Currently supported UI languages */ - inline const smart_objects::SmartObject* - ui_supported_languages() const; + inline const smart_objects::SmartObject* ui_supported_languages() const; /* * @brief Sets supported UI languages @@ -152,8 +152,7 @@ class HMICapabilities { * * @return Currently active VR language */ - inline const hmi_apis::Common_Language::eType& - active_vr_language() const; + const hmi_apis::Common_Language::eType active_vr_language() const; /* * @brief Sets currently active VR language @@ -167,8 +166,7 @@ class HMICapabilities { * * @return Currently supported VR languages */ - inline const smart_objects::SmartObject* - vr_supported_languages() const; + inline const smart_objects::SmartObject* vr_supported_languages() const; /* * @brief Sets supported VR languages @@ -183,8 +181,7 @@ class HMICapabilities { * * @return Currently active TTS language */ - inline const hmi_apis::Common_Language::eType& - active_tts_language() const; + const hmi_apis::Common_Language::eType active_tts_language() const; /* * @brief Sets currently active TTS language @@ -192,15 +189,14 @@ class HMICapabilities { * @param language Currently active TTS language */ void set_active_tts_language( - const hmi_apis::Common_Language::eType& 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; + inline const smart_objects::SmartObject* tts_supported_languages() const; /* * @brief Sets supported TTS languages @@ -215,8 +211,7 @@ class HMICapabilities { * * @return Currently supported display capabilities */ - inline const smart_objects::SmartObject* - display_capabilities() const; + inline const smart_objects::SmartObject* display_capabilities() const; /* * @brief Sets supported display capabilities @@ -231,8 +226,7 @@ class HMICapabilities { * * @return Currently supported HMI zone capabilities */ - inline const smart_objects::SmartObject* - hmi_zone_capabilities() const; + inline const smart_objects::SmartObject* hmi_zone_capabilities() const; /* * @brief Sets supported HMI zone capabilities @@ -247,8 +241,7 @@ class HMICapabilities { * * @return Currently supported SoftButton's capabilities */ - inline const smart_objects::SmartObject* - soft_button_capabilities() const; + inline const smart_objects::SmartObject* soft_button_capabilities() const; /* * @brief Sets supported SoftButton's capabilities @@ -311,12 +304,26 @@ class HMICapabilities { const smart_objects::SmartObject& audio_pass_thru_capabilities); /* + * @brief Sets supported pcm_stream capabilities + * + * @param supported pcm stream capabilities + */ + void set_pcm_stream_capabilities( + const smart_objects::SmartObject& pcm_stream_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; + inline const smart_objects::SmartObject* audio_pass_thru_capabilities() const; + + /* + * @brief Retrieves information about the pcm_stream capabilities + * + * @return Currently supported pcm_streaming capabilities + */ + inline const smart_objects::SmartObject* pcm_stream_capabilities() const; /* * @brief Retrieves information about the preset bank capabilities @@ -360,7 +367,7 @@ class HMICapabilities { * @param prerecorded_speech supported prerecorded speech */ void set_prerecorded_speech( - const smart_objects::SmartObject& prerecorded_speech); + const smart_objects::SmartObject& prerecorded_speech); /* * @brief Interface used to store information if navigation @@ -393,7 +400,8 @@ class HMICapabilities { inline bool phone_call_supported() const; /* - * @brief Interface used to store information about software version of the target + * @brief Interface used to store information about software version of the + *target * * @param ccpu_version Received system/hmi software version */ @@ -406,8 +414,18 @@ class HMICapabilities { */ inline const std::string& ccpu_version() const; - protected: + void Init(resumption::LastState* last_state); + /** + * @brief return component which follows for correctness of + * languages + * @return HMI language handler + */ + HMILanguageHandler& get_hmi_language_handler() { + return hmi_language_handler_; + } + + protected: /* * @brief Loads capabilities from local file in case SDL was launched * without HMI @@ -426,8 +444,8 @@ class HMICapabilities { * @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); + bool check_existing_json_member(const Json::Value& json_member, + const char* name_of_member); /* * @brief function converts json object "languages" to smart object @@ -440,41 +458,43 @@ class HMICapabilities { 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_; + 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 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_; + 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_; - bool is_navigation_supported_; - bool is_phone_call_supported_; - std::string ccpu_version_; - - ApplicationManagerImpl* app_mngr_; + 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* pcm_stream_capabilities_; + smart_objects::SmartObject* prerecorded_speech_; + std::string ccpu_version_; + bool is_navigation_supported_; + bool is_phone_call_supported_; + + ApplicationManager& app_mngr_; + HMILanguageHandler hmi_language_handler_; DISALLOW_COPY_AND_ASSIGN(HMICapabilities); }; @@ -499,48 +519,33 @@ 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 { +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 { +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 { +const smart_objects::SmartObject* HMICapabilities::tts_supported_languages() + const { return tts_supported_languages_; } -const smart_objects::SmartObject* -HMICapabilities::display_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::display_capabilities() + const { return display_capabilities_; } -const smart_objects::SmartObject* -HMICapabilities::hmi_zone_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::hmi_zone_capabilities() + const { return hmi_zone_capabilities_; } -const smart_objects::SmartObject* -HMICapabilities::soft_button_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::soft_button_capabilities() + const { return soft_buttons_capabilities_; } @@ -548,8 +553,7 @@ const smart_objects::SmartObject* HMICapabilities::button_capabilities() const { return button_capabilities_; } -const smart_objects::SmartObject* -HMICapabilities::speech_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::speech_capabilities() const { return speech_capabilities_; } @@ -562,8 +566,13 @@ HMICapabilities::audio_pass_thru_capabilities() const { return audio_pass_thru_capabilities_; } -const smart_objects::SmartObject* -HMICapabilities::preset_bank_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::pcm_stream_capabilities() + const { + return pcm_stream_capabilities_; +} + +const smart_objects::SmartObject* HMICapabilities::preset_bank_capabilities() + const { return preset_bank_capabilities_; } @@ -575,11 +584,14 @@ const smart_objects::SmartObject* HMICapabilities::vehicle_type() const { return vehicle_type_; } -const smart_objects::SmartObject* -HMICapabilities::prerecorded_speech() const { +const smart_objects::SmartObject* HMICapabilities::prerecorded_speech() const { return prerecorded_speech_; } +const std::string& HMICapabilities::ccpu_version() const { + return ccpu_version_; +} + bool HMICapabilities::navigation_supported() const { return is_navigation_supported_; } @@ -588,10 +600,6 @@ bool HMICapabilities::phone_call_supported() const { return is_phone_call_supported_; } -const std::string& HMICapabilities::ccpu_version() const { - return ccpu_version_; -} - } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_ |