diff options
author | Levchenko <slevchenko@SLevchenko-lws-unq> | 2016-08-02 14:30:35 +0300 |
---|---|---|
committer | Levchenko <slevchenko@SLevchenko-lws-unq> | 2016-08-04 17:30:29 +0300 |
commit | 1c2cf9caee4d58e030a9be7064ed3b05768a37f0 (patch) | |
tree | bf21f1ef6a9d7c06cb551c2e635ce31a69d4dbce /src/components/application_manager/include/application_manager | |
parent | f6ebfe592402a87fe7118f0dbe65f8c46102e4e8 (diff) | |
download | sdl_core-1c2cf9caee4d58e030a9be7064ed3b05768a37f0.tar.gz |
Divide HMICapabilities onto interface and implementation
`HMICapabilities` was divided onto
interface and implementation.
Related to: APPLINK-24892
Diffstat (limited to 'src/components/application_manager/include/application_manager')
-rw-r--r-- | src/components/application_manager/include/application_manager/hmi_capabilities_impl.h (renamed from src/components/application_manager/include/application_manager/hmi_capabilities.h) | 287 |
1 files changed, 96 insertions, 191 deletions
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h index f94c8125c8..0f8eed8ef2 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h @@ -30,9 +30,10 @@ * 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_ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_ +#include "application_manager/hmi_capabilities.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" #include "json/json.h" @@ -42,38 +43,39 @@ namespace NsSmartDeviceLink { namespace NsSmartObjects { class SmartObject; -} -} +} // namespace NsSmartObjects +} // namespace NsSmartDeviceLink + namespace resumption { class LastState; -} +} // namespace resumption namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; namespace application_manager { class ApplicationManager; -class HMICapabilities { +class HMICapabilitiesImpl : public HMICapabilities { public: /* * @ Class constructor * * @param app_mngr Application manager pointer */ - explicit HMICapabilities(ApplicationManager& app_mngr); + explicit HMICapabilitiesImpl(ApplicationManager& app_mngr); /* * @brief Class destructor * */ - virtual ~HMICapabilities(); + virtual ~HMICapabilitiesImpl(); /** * @brief Checks if all HMI capabilities received * * @return TRUE if all information received, otherwise FALSE */ - bool is_hmi_capabilities_initialized() const; + bool is_hmi_capabilities_initialized() const OVERRIDE; /* * @brief Checks is image type(Static/Dynamic) requested by @@ -81,27 +83,42 @@ class HMICapabilities { * @param image_type recieved type of image from Enum. * @return Bool true if supported */ - bool VerifyImageType(int32_t image_type) const; + bool VerifyImageType(const int32_t image_type) const OVERRIDE; /** * @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); + bool is_vr_cooperating() const OVERRIDE; + void set_is_vr_cooperating(const bool value) OVERRIDE; + + bool is_tts_cooperating() const OVERRIDE; + void set_is_tts_cooperating(const bool value) OVERRIDE; - inline bool is_tts_cooperating() const; - void set_is_tts_cooperating(bool value); + bool is_ui_cooperating() const OVERRIDE; + void set_is_ui_cooperating(const bool value) OVERRIDE; - inline bool is_ui_cooperating() const; - void set_is_ui_cooperating(bool value); + bool is_navi_cooperating() const OVERRIDE; + void set_is_navi_cooperating(const bool value) OVERRIDE; - inline bool is_navi_cooperating() const; - void set_is_navi_cooperating(bool value); + bool is_ivi_cooperating() const OVERRIDE; + void set_is_ivi_cooperating(const bool value) OVERRIDE; - inline bool is_ivi_cooperating() const; - void set_is_ivi_cooperating(bool value); + /* + * @brief Interface used to store information about software version of the + *target + * + * @param ccpu_version Received system/hmi software version + */ + void set_ccpu_version(const std::string& ccpu_version) OVERRIDE; + + /* + * @brief Returns software version of the target + * + * @return TRUE if it supported, otherwise FALSE + */ + const std::string& ccpu_version() const OVERRIDE; /* * @brief Retrieves if mixing audio is supported by HMI @@ -109,35 +126,36 @@ class HMICapabilities { * * @return Current state of the mixing audio flag */ - inline bool attenuated_supported() const; + bool attenuated_supported() const OVERRIDE; /* * @brief Sets state for mixing audio * * @param state New state to be set */ - void set_attenuated_supported(bool state); + void set_attenuated_supported(const bool state) OVERRIDE; /* * @brief Retrieves currently active UI language * * @return Currently active UI language */ - const hmi_apis::Common_Language::eType active_ui_language() const; + const hmi_apis::Common_Language::eType active_ui_language() const OVERRIDE; /* * @brief Sets currently active UI language * * @param language Currently active UI language */ - void set_active_ui_language(const hmi_apis::Common_Language::eType& language); + void set_active_ui_language( + const hmi_apis::Common_Language::eType language) OVERRIDE; /* * @brief Retrieves UI supported languages * * @return Currently supported UI languages */ - inline const smart_objects::SmartObject* ui_supported_languages() const; + const smart_objects::SmartObject* ui_supported_languages() const OVERRIDE; /* * @brief Sets supported UI languages @@ -145,28 +163,29 @@ class HMICapabilities { * @param supported_languages Supported UI languages */ void set_ui_supported_languages( - const smart_objects::SmartObject& supported_languages); + const smart_objects::SmartObject& supported_languages) OVERRIDE; /* * @brief Retrieves currently active VR language * * @return Currently active VR language */ - const hmi_apis::Common_Language::eType active_vr_language() const; + const hmi_apis::Common_Language::eType active_vr_language() const OVERRIDE; /* * @brief Sets currently active VR language * * @param language Currently active VR language */ - void set_active_vr_language(const hmi_apis::Common_Language::eType& language); + void set_active_vr_language( + const hmi_apis::Common_Language::eType language) OVERRIDE; /* * @brief Retrieves VR supported languages * * @return Currently supported VR languages */ - inline const smart_objects::SmartObject* vr_supported_languages() const; + const smart_objects::SmartObject* vr_supported_languages() const OVERRIDE; /* * @brief Sets supported VR languages @@ -174,14 +193,14 @@ class HMICapabilities { * @param supported_languages Supported VR languages */ void set_vr_supported_languages( - const smart_objects::SmartObject& supported_languages); + const smart_objects::SmartObject& supported_languages) OVERRIDE; /* * @brief Retrieves currently active TTS language * * @return Currently active TTS language */ - const hmi_apis::Common_Language::eType active_tts_language() const; + const hmi_apis::Common_Language::eType active_tts_language() const OVERRIDE; /* * @brief Sets currently active TTS language @@ -189,14 +208,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) OVERRIDE; /* * @brief Retrieves TTS supported languages * * @return Currently supported TTS languages */ - inline const smart_objects::SmartObject* tts_supported_languages() const; + const smart_objects::SmartObject* tts_supported_languages() const OVERRIDE; /* * @brief Sets supported TTS languages @@ -204,14 +223,14 @@ class HMICapabilities { * @param supported_languages Supported TTS languages */ void set_tts_supported_languages( - const smart_objects::SmartObject& supported_languages); + const smart_objects::SmartObject& supported_languages) OVERRIDE; /* * @brief Retrieves information about the display capabilities * * @return Currently supported display capabilities */ - inline const smart_objects::SmartObject* display_capabilities() const; + const smart_objects::SmartObject* display_capabilities() const OVERRIDE; /* * @brief Sets supported display capabilities @@ -219,14 +238,14 @@ class HMICapabilities { * @param display_capabilities supported display capabilities */ void set_display_capabilities( - const smart_objects::SmartObject& display_capabilities); + const smart_objects::SmartObject& display_capabilities) OVERRIDE; /* * @brief Retrieves information about the HMI zone capabilities * * @return Currently supported HMI zone capabilities */ - inline const smart_objects::SmartObject* hmi_zone_capabilities() const; + const smart_objects::SmartObject* hmi_zone_capabilities() const OVERRIDE; /* * @brief Sets supported HMI zone capabilities @@ -234,14 +253,14 @@ class HMICapabilities { * @param hmi_zone_capabilities supported HMI zone capabilities */ void set_hmi_zone_capabilities( - const smart_objects::SmartObject& hmi_zone_capabilities); + const smart_objects::SmartObject& hmi_zone_capabilities) OVERRIDE; /* * @brief Retrieves information about the SoftButton's capabilities * * @return Currently supported SoftButton's capabilities */ - inline const smart_objects::SmartObject* soft_button_capabilities() const; + const smart_objects::SmartObject* soft_button_capabilities() const OVERRIDE; /* * @brief Sets supported SoftButton's capabilities @@ -249,14 +268,14 @@ class HMICapabilities { * @param soft_button_capabilities supported SoftButton's capabilities */ void set_soft_button_capabilities( - const smart_objects::SmartObject& soft_button_capabilities); + const smart_objects::SmartObject& soft_button_capabilities) OVERRIDE; /* * @brief Retrieves information about the Button's capabilities * * @return Currently supported Button's capabilities */ - inline const smart_objects::SmartObject* button_capabilities() const; + const smart_objects::SmartObject* button_capabilities() const OVERRIDE; /* * @brief Sets supported Button's capabilities @@ -264,7 +283,7 @@ class HMICapabilities { * @param soft_button_capabilities supported Button's capabilities */ void set_button_capabilities( - const smart_objects::SmartObject& button_capabilities); + const smart_objects::SmartObject& button_capabilities) OVERRIDE; /* * @brief Sets supported speech capabilities @@ -272,28 +291,29 @@ class HMICapabilities { * @param speech_capabilities supported speech capabilities */ void set_speech_capabilities( - const smart_objects::SmartObject& speech_capabilities); + const smart_objects::SmartObject& speech_capabilities) OVERRIDE; /* * @brief Retrieves information about the speech capabilities * * @return Currently supported speech capabilities */ - inline const smart_objects::SmartObject* speech_capabilities() const; + const smart_objects::SmartObject* speech_capabilities() const OVERRIDE; /* * @brief Sets supported VR capabilities * * @param vr_capabilities supported VR capabilities */ - void set_vr_capabilities(const smart_objects::SmartObject& vr_capabilities); + void set_vr_capabilities( + const smart_objects::SmartObject& vr_capabilities) OVERRIDE; /* * @brief Retrieves information about the VR capabilities * * @return Currently supported VR capabilities */ - inline const smart_objects::SmartObject* vr_capabilities() const; + const smart_objects::SmartObject* vr_capabilities() const OVERRIDE; /* * @brief Sets supported audio_pass_thru capabilities @@ -301,36 +321,37 @@ class HMICapabilities { * @param vr_capabilities supported audio_pass_thru capabilities */ void set_audio_pass_thru_capabilities( - const smart_objects::SmartObject& audio_pass_thru_capabilities); + const smart_objects::SmartObject& audio_pass_thru_capabilities) OVERRIDE; /* - * @brief Sets supported pcm_stream capabilities + * @brief Retrieves information about the audio_pass_thru capabilities * - * @param supported pcm stream capabilities + * @return Currently supported audio_pass_thru capabilities */ - void set_pcm_stream_capabilities( - const smart_objects::SmartObject& pcm_stream_capabilities); + const smart_objects::SmartObject* audio_pass_thru_capabilities() + const OVERRIDE; /* - * @brief Retrieves information about the audio_pass_thru capabilities + * @brief Sets supported pcm_stream capabilities * - * @return Currently supported audio_pass_thru capabilities + * @param supported pcm_stream capabilities */ - inline const smart_objects::SmartObject* audio_pass_thru_capabilities() const; + void set_pcm_stream_capabilities( + const smart_objects::SmartObject& pcm_stream_capabilities) OVERRIDE; /* * @brief Retrieves information about the pcm_stream capabilities * * @return Currently supported pcm_streaming capabilities */ - inline const smart_objects::SmartObject* pcm_stream_capabilities() const; + const smart_objects::SmartObject* pcm_stream_capabilities() const OVERRIDE; /* * @brief Retrieves information about the preset bank capabilities * * @return Currently supported preset bank capabilities */ - inline const smart_objects::SmartObject* preset_bank_capabilities() const; + const smart_objects::SmartObject* preset_bank_capabilities() const OVERRIDE; /* * @brief Sets supported preset bank capabilities @@ -338,28 +359,29 @@ class HMICapabilities { * @param soft_button_capabilities supported preset bank capabilities */ void set_preset_bank_capabilities( - const smart_objects::SmartObject& preset_bank_capabilities); + const smart_objects::SmartObject& preset_bank_capabilities) OVERRIDE; /* * @brief Sets vehicle information(make, model, modelYear) * * @param vehicle_type Cuurent vehicle information */ - void set_vehicle_type(const smart_objects::SmartObject& vehicle_type); + void set_vehicle_type( + const smart_objects::SmartObject& vehicle_type) OVERRIDE; /* * @brief Retrieves vehicle information(make, model, modelYear) * * @param vehicle_type Cuurent vehicle information */ - inline const smart_objects::SmartObject* vehicle_type() const; + const smart_objects::SmartObject* vehicle_type() const OVERRIDE; /* * @brief Retrieves information about the prerecorded speech * * @return Currently supported prerecorded speech */ - inline const smart_objects::SmartObject* prerecorded_speech() const; + const smart_objects::SmartObject* prerecorded_speech() const OVERRIDE; /* * @brief Sets supported prerecorded speech @@ -367,7 +389,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) OVERRIDE; /* * @brief Interface used to store information if navigation @@ -375,14 +397,14 @@ class HMICapabilities { * * @param supported Indicates if navigation supported by the system */ - void set_navigation_supported(bool supported); + void set_navigation_supported(const bool supported) OVERRIDE; /* * @brief Retrieves information if navi supported by the system * * @return TRUE if it supported, otherwise FALSE */ - inline bool navigation_supported() const; + bool navigation_supported() const OVERRIDE; /* * @brief Interface used to store information if phone call @@ -390,40 +412,23 @@ class HMICapabilities { * * @param supported Indicates if navigation supported by the sustem */ - void set_phone_call_supported(bool supported); + void set_phone_call_supported(const bool supported) OVERRIDE; /* * @brief Retrieves information if phone call supported by the system * * @return TRUE if it supported, otherwise FALSE */ - inline bool phone_call_supported() const; + bool phone_call_supported() const OVERRIDE; - /* - * @brief Interface used to store information about software version of the - *target - * - * @param ccpu_version Received system/hmi software version - */ - void set_ccpu_version(const std::string& ccpu_version); + void Init(resumption::LastState* last_state) OVERRIDE; /* - * @brief Returns software version of the target - * - * @return TRUE if it supported, otherwise FALSE - */ - inline const std::string& ccpu_version() const; - - 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_; - } + HMILanguageHandler& get_hmi_language_handler() OVERRIDE; protected: /* @@ -445,7 +450,7 @@ class HMICapabilities { * member does not exist. */ bool check_existing_json_member(const Json::Value& json_member, - const char* name_of_member); + const char* name_of_member) const OVERRIDE; /* * @brief function converts json object "languages" to smart object @@ -454,8 +459,9 @@ class HMICapabilities { * @param languages - the converted object * */ - void convert_json_languages_to_obj(Json::Value& json_languages, - smart_objects::SmartObject& languages); + void convert_json_languages_to_obj( + const Json::Value& json_languages, + smart_objects::SmartObject& languages) const OVERRIDE; private: bool is_vr_cooperating_; @@ -489,117 +495,16 @@ class HMICapabilities { 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_; + std::string ccpu_version_; ApplicationManager& app_mngr_; HMILanguageHandler hmi_language_handler_; - DISALLOW_COPY_AND_ASSIGN(HMICapabilities); + DISALLOW_COPY_AND_ASSIGN(HMICapabilitiesImpl); }; -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 smart_objects::SmartObject* HMICapabilities::ui_supported_languages() - const { - return ui_supported_languages_; -} - -const smart_objects::SmartObject* HMICapabilities::vr_supported_languages() - const { - return vr_supported_languages_; -} - -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::pcm_stream_capabilities() - const { - return pcm_stream_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_; -} - -const std::string& HMICapabilities::ccpu_version() const { - return ccpu_version_; -} - -bool HMICapabilities::navigation_supported() const { - return is_navigation_supported_; -} - -bool HMICapabilities::phone_call_supported() const { - return is_phone_call_supported_; -} - } // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_ |