From 5b5ef7d12be3491cfe6699ad90335cae0b5fcfbc Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Fri, 25 Mar 2022 09:53:57 +0000 Subject: [PATCH] fix warning Signed-off-by: zhouyongfei --- etc/para/include/para_handle.h | 7 ++-- etc/para/src/para_handle.cpp | 4 +-- .../include/i_input_method_agent.h | 6 ++-- .../include/i_input_method_core.h | 6 ++-- .../include/input_method_ability.h | 6 ++-- .../include/input_method_agent_proxy.h | 7 ++-- .../include/input_method_agent_stub.h | 15 +++++---- .../include/input_method_core_proxy.h | 27 ++++++++-------- .../include/input_method_core_stub.h | 28 ++++++++-------- .../src/input_method_ability.cpp | 4 +-- .../src/input_method_agent_proxy.cpp | 4 +-- .../src/input_method_agent_stub.cpp | 4 +-- .../src/input_method_core_proxy.cpp | 4 +-- .../src/input_method_core_stub.cpp | 4 +-- .../include/i_input_client.h | 6 ++-- .../include/i_input_data_channel.h | 6 ++-- .../include/input_client_proxy.h | 6 ++-- .../include/input_client_stub.h | 7 ++-- .../include/input_data_channel_proxy.h | 6 ++-- .../include/input_data_channel_stub.h | 7 ++-- .../include/input_method_controller.h | 7 ++-- .../input_method_system_ability_proxy.h | 32 +++++++++---------- .../include/input_method_utils.h | 9 ++++-- .../src/input_client_proxy.cpp | 4 +-- .../src/input_client_stub.cpp | 4 +-- .../src/input_data_channel_proxy.cpp | 4 +-- .../src/input_data_channel_stub.cpp | 4 +-- .../src/input_method_controller.cpp | 4 +-- .../src/input_method_system_ability_proxy.cpp | 4 +-- .../src/input_method_utils.cpp | 5 ++- .../include/js_input_method_controller.h | 7 ++-- .../include/js_input_method_registry.h | 6 ++-- .../include/js_input_method_setting.h | 7 ++-- .../include/js_input_method_utils.h | 6 ++-- .../inputmethod/src/input_method_module.cpp | 2 +- .../src/js_input_method_controller.cpp | 4 +-- .../src/js_input_method_registry.cpp | 4 +-- .../src/js_input_method_setting.cpp | 4 +-- .../inputmethod/src/js_input_method_utils.cpp | 4 +-- .../include/js_editor_attribute.h | 7 ++-- .../include/js_input_method_engine.h | 7 ++-- .../include/js_input_method_engine_listener.h | 7 ++-- .../include/js_input_method_engine_registry.h | 6 ++-- .../include/js_input_method_engine_utils.h | 6 ++-- .../include/js_keyboard_controller.h | 7 ++-- .../include/js_keyboard_delegate.h | 7 ++-- .../include/js_keyboard_delegate_listener.h | 7 ++-- .../include/js_text_input_client.h | 7 ++-- .../src/input_method_engine_module.cpp | 2 +- .../src/js_editor_attribute.cpp | 4 +-- .../src/js_input_method_engine.cpp | 4 +-- .../src/js_input_method_engine_listener.cpp | 4 +-- .../src/js_input_method_engine_registry.cpp | 4 +-- .../src/js_input_method_engine_utils.cpp | 4 +-- .../src/js_keyboard_controller.cpp | 4 +-- .../src/js_keyboard_delegate.cpp | 4 +-- .../src/js_keyboard_delegate_listener.cpp | 4 +-- .../src/js_text_input_client.cpp | 4 +-- services/include/global.h | 8 ++--- services/include/i_input_control_channel.h | 6 ++-- .../include/i_input_method_system_ability.h | 6 ++-- services/include/i_platform_api.h | 6 ++-- services/include/i_platform_callback.h | 6 ++-- services/include/im_common_event_manager.h | 2 +- services/include/input_attribute.h | 9 +++--- services/include/input_channel.h | 9 +++--- .../include/input_control_channel_proxy.h | 14 ++++---- services/include/input_control_channel_stub.h | 17 +++++----- .../input_method_ability_connection_stub.h | 6 ++-- services/include/input_method_property.h | 8 ++--- services/include/input_method_setting.h | 8 ++--- .../include/input_method_system_ability.h | 22 +++++++------ .../input_method_system_ability_stub.h | 21 ++++++------ services/include/keyboard_type.h | 8 ++--- services/include/message.h | 7 ++-- services/include/message_handler.h | 6 ++-- services/include/peruser_session.h | 8 +++-- services/include/peruser_setting.h | 6 ++-- services/include/platform.h | 6 ++-- services/include/platform_callback_stub.h | 10 +++--- services/include/utils.h | 6 ++-- services/src/global.cpp | 7 ++-- services/src/im_common_event_manager.cpp | 4 +-- services/src/input_attribute.cpp | 4 +-- services/src/input_channel.cpp | 4 +-- services/src/input_control_channel_proxy.cpp | 4 +-- services/src/input_control_channel_stub.cpp | 4 +-- .../input_method_ability_connection_stub.cpp | 4 +-- services/src/input_method_property.cpp | 4 +-- services/src/input_method_setting.cpp | 10 +++--- services/src/input_method_system_ability.cpp | 8 ++--- .../src/input_method_system_ability_stub.cpp | 4 +-- services/src/keyboard_type.cpp | 4 +-- services/src/message.cpp | 4 +-- services/src/message_handler.cpp | 5 ++- services/src/peruser_session.cpp | 18 +++++------ services/src/peruser_setting.cpp | 24 +++++++------- services/src/platform.cpp | 4 +-- services/src/platform_callback_stub.cpp | 4 +-- unitest/src/input_method_ability_test.cpp | 4 +-- unitest/src/input_method_controller_test.cpp | 4 +-- 101 files changed, 370 insertions(+), 347 deletions(-) diff --git a/etc/para/include/para_handle.h b/etc/para/include/para_handle.h index b285c21..183e91b 100644 --- a/etc/para/include/para_handle.h +++ b/etc/para/include/para_handle.h @@ -24,12 +24,13 @@ namespace OHOS { virtual ~ParaHandle() = default; static bool SetDefaultIme(int32_t userId, const std::string &imeName); static std::string GetDefaultIme(int32_t userId); + private: static const char *DEFAULT_IME_KEY; static const char *DEFAULT_IME_NAME; static constexpr int CONFIG_LEN = 128; static const int32_t main_userId = 100; }; - } -} -#endif // OHOS_MISCSERVICES_INPUTMETHOD_PARA_HANDLE_H + } // namespace MiscServices +} // namespace OHOS +#endif // ETC_PARA_INCLUDE_PARA_HANDLE_H diff --git a/etc/para/src/para_handle.cpp b/etc/para/src/para_handle.cpp index 617a9b6..70812ff 100644 --- a/etc/para/src/para_handle.cpp +++ b/etc/para/src/para_handle.cpp @@ -44,5 +44,5 @@ namespace OHOS { SetDefaultIme(userId, DEFAULT_IME_NAME); return DEFAULT_IME_NAME; } - } -} + } // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_ability/include/i_input_method_agent.h b/frameworks/inputmethod_ability/include/i_input_method_agent.h index 74d7156..8307a90 100644 --- a/frameworks/inputmethod_ability/include/i_input_method_agent.h +++ b/frameworks/inputmethod_ability/include/i_input_method_agent.h @@ -40,6 +40,6 @@ namespace MiscServices { virtual void OnSelectionChange(std::u16string text, int32_t oldBegin, int32_t oldEnd, int32_t newBegin, int32_t newEnd) = 0; }; -} -} -#endif // FM_IMMS_PROJECT_IINPUTMETHODAGENT_H +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_I_INPUT_METHOD_AGENT_H diff --git a/frameworks/inputmethod_ability/include/i_input_method_core.h b/frameworks/inputmethod_ability/include/i_input_method_core.h index 8018dd8..2d0c8c9 100644 --- a/frameworks/inputmethod_ability/include/i_input_method_core.h +++ b/frameworks/inputmethod_ability/include/i_input_method_core.h @@ -61,6 +61,6 @@ namespace MiscServices { virtual void SetClientState(bool state) = 0; virtual void StopInputService(std::string imeId) = 0; }; -} -} -#endif // FM_IMMS_PROJECT_IINPUTMETHODCORE_H +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_I_INPUT_METHOD_CORE_H diff --git a/frameworks/inputmethod_ability/include/input_method_ability.h b/frameworks/inputmethod_ability/include/input_method_ability.h index 6372251..748ada6 100644 --- a/frameworks/inputmethod_ability/include/input_method_ability.h +++ b/frameworks/inputmethod_ability/include/input_method_ability.h @@ -105,6 +105,6 @@ namespace MiscServices { void ShowInputWindow(); void DissmissInputWindow(); }; -} -} -#endif // FM_IMMS_PROJECT_INPUTMETHODABILITY_H \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_ABILITY_H diff --git a/frameworks/inputmethod_ability/include/input_method_agent_proxy.h b/frameworks/inputmethod_ability/include/input_method_agent_proxy.h index 967e651..80452ad 100644 --- a/frameworks/inputmethod_ability/include/input_method_agent_proxy.h +++ b/frameworks/inputmethod_ability/include/input_method_agent_proxy.h @@ -31,9 +31,10 @@ namespace MiscServices { void OnCursorUpdate(int32_t positionX, int32_t positionY, int32_t height) override; void OnSelectionChange(std::u16string text, int32_t oldBegin, int32_t oldEnd, int32_t newBegin, int32_t newEnd) override; + private: static inline BrokerDelegator delegator_; }; -} -} -#endif // FM_IMC_PROJECT_INPUTMETHODAGENTPROXY_H \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_AGENT_PROXY_H diff --git a/frameworks/inputmethod_ability/include/input_method_agent_stub.h b/frameworks/inputmethod_ability/include/input_method_agent_stub.h index b5c22f2..e49c88e 100644 --- a/frameworks/inputmethod_ability/include/input_method_agent_stub.h +++ b/frameworks/inputmethod_ability/include/input_method_agent_stub.h @@ -28,18 +28,19 @@ namespace MiscServices { public: explicit InputMethodAgentStub(); virtual ~InputMethodAgentStub(); - virtual int32_t OnRemoteRequest(uint32_t code, + int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual bool DispatchKeyEvent(MessageParcel &data) override; - virtual void OnCursorUpdate(int32_t positionX, int32_t positionY, int height) override; - virtual void OnSelectionChange(std::u16string text, int32_t oldBegin, int32_t oldEnd, + bool DispatchKeyEvent(MessageParcel &data) override; + void OnCursorUpdate(int32_t positionX, int32_t positionY, int height) override; + void OnSelectionChange(std::u16string text, int32_t oldBegin, int32_t oldEnd, int32_t newBegin, int32_t newEnd) override; void SetMessageHandler(MessageHandler *msgHandler); + private: MessageHandler *msgHandler_; }; -} -} -#endif // FM_IMC_PROJECT_INPUTMETHODAGENTSTUB_H \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_AGENT_STUB_H diff --git a/frameworks/inputmethod_ability/include/input_method_core_proxy.h b/frameworks/inputmethod_ability/include/input_method_core_proxy.h index e4e157c..2afe62b 100644 --- a/frameworks/inputmethod_ability/include/input_method_core_proxy.h +++ b/frameworks/inputmethod_ability/include/input_method_core_proxy.h @@ -34,22 +34,23 @@ namespace MiscServices { DISALLOW_COPY_AND_MOVE(InputMethodCoreProxy); - virtual int32_t initializeInput(sptr& startInputToken, int32_t displayId, + int32_t initializeInput(sptr& startInputToken, int32_t displayId, sptr& inputControlChannel) override; - virtual bool startInput(const sptr& inputDataChannel, + bool startInput(const sptr& inputDataChannel, const InputAttribute& editorAttribute, bool supportPhysicalKbd) override; - virtual int32_t stopInput() override; - virtual bool showKeyboard(const sptr& inputDataChannel) override; - virtual bool hideKeyboard(int32_t flags) override; - virtual int32_t setKeyboardType(const KeyboardType& type) override; - virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override; - virtual int32_t InitInputControlChannel(sptr &inputControlChannel) override; - virtual void SetClientState(bool state) override; - virtual void StopInputService(std::string imeId) override; + int32_t stopInput() override; + bool showKeyboard(const sptr& inputDataChannel) override; + bool hideKeyboard(int32_t flags) override; + int32_t setKeyboardType(const KeyboardType& type) override; + int32_t getKeyboardWindowHeight(int32_t retHeight) override; + int32_t InitInputControlChannel(sptr &inputControlChannel) override; + void SetClientState(bool state) override; + void StopInputService(std::string imeId) override; + private: static inline BrokerDelegator delegator_; }; -} -} -#endif // FM_IMC_PROJECT_INPUTMETHODCOREPROXY_H \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_CORE_PROXY_H diff --git a/frameworks/inputmethod_ability/include/input_method_core_stub.h b/frameworks/inputmethod_ability/include/input_method_core_stub.h index ae6a3c6..eddec19 100644 --- a/frameworks/inputmethod_ability/include/input_method_core_stub.h +++ b/frameworks/inputmethod_ability/include/input_method_core_stub.h @@ -38,30 +38,30 @@ namespace MiscServices { DISALLOW_COPY_AND_MOVE(InputMethodCoreStub); explicit InputMethodCoreStub(int userId); virtual ~InputMethodCoreStub(); - virtual int OnRemoteRequest(uint32_t code, + int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual int32_t initializeInput(sptr& startInputToken, int32_t displayId, + int32_t initializeInput(sptr& startInputToken, int32_t displayId, sptr& inputControlChannel) override; - virtual bool startInput(const sptr& inputDataChannel, + bool startInput(const sptr& inputDataChannel, const InputAttribute& editorAttribute, bool supportPhysicalKbd) override; - virtual int32_t stopInput() override; - virtual bool showKeyboard(const sptr& inputDataChannel) override; - virtual bool hideKeyboard(int32_t flags)override; - virtual int32_t setKeyboardType(const KeyboardType& type) override; - virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override; - virtual int32_t InitInputControlChannel(sptr &inputControlChannel) override; - virtual void SetClientState(bool state) override; - virtual void StopInputService(std::string imeId) override; + int32_t stopInput() override; + bool showKeyboard(const sptr& inputDataChannel) override; + bool hideKeyboard(int32_t flags)override; + int32_t setKeyboardType(const KeyboardType& type) override; + int32_t getKeyboardWindowHeight(int32_t retHeight) override; + int32_t InitInputControlChannel(sptr &inputControlChannel) override; + void SetClientState(bool state) override; + void StopInputService(std::string imeId) override; void SetMessageHandler(MessageHandler *msgHandler); private: int userId_; MessageHandler *msgHandler_; }; -} -} -#endif // FM_IMMS_PROJECT_INPUTCONTROLCHANNEL_SK_H +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_ABILITY_INCLUDE_INPUT_METHOD_CORE_STUB_H diff --git a/frameworks/inputmethod_ability/src/input_method_ability.cpp b/frameworks/inputmethod_ability/src/input_method_ability.cpp index 7a26b6b..546660a 100644 --- a/frameworks/inputmethod_ability/src/input_method_ability.cpp +++ b/frameworks/inputmethod_ability/src/input_method_ability.cpp @@ -458,5 +458,5 @@ namespace MiscServices { } inputDataChannel->StopInput(); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_ability/src/input_method_agent_proxy.cpp b/frameworks/inputmethod_ability/src/input_method_agent_proxy.cpp index a987337..eecec80 100644 --- a/frameworks/inputmethod_ability/src/input_method_agent_proxy.cpp +++ b/frameworks/inputmethod_ability/src/input_method_agent_proxy.cpp @@ -73,5 +73,5 @@ namespace MiscServices { Remote()->SendRequest(ON_SELECTION_CHANGE, data, reply, option); } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_ability/src/input_method_agent_stub.cpp b/frameworks/inputmethod_ability/src/input_method_agent_stub.cpp index b058415..ee02c32 100644 --- a/frameworks/inputmethod_ability/src/input_method_agent_stub.cpp +++ b/frameworks/inputmethod_ability/src/input_method_agent_stub.cpp @@ -116,5 +116,5 @@ namespace MiscServices { { msgHandler_ = msgHandler; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_ability/src/input_method_core_proxy.cpp b/frameworks/inputmethod_ability/src/input_method_core_proxy.cpp index 6b16bbf..9af050f 100644 --- a/frameworks/inputmethod_ability/src/input_method_core_proxy.cpp +++ b/frameworks/inputmethod_ability/src/input_method_core_proxy.cpp @@ -311,5 +311,5 @@ namespace MiscServices { retHeight = reply.ReadInt32(); return ErrorCode::NO_ERROR; } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_ability/src/input_method_core_stub.cpp b/frameworks/inputmethod_ability/src/input_method_core_stub.cpp index b4d9f4a..6e1eeb6 100644 --- a/frameworks/inputmethod_ability/src/input_method_core_stub.cpp +++ b/frameworks/inputmethod_ability/src/input_method_core_stub.cpp @@ -304,5 +304,5 @@ namespace MiscServices { { msgHandler_ = msgHandler; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_controller/include/i_input_client.h b/frameworks/inputmethod_controller/include/i_input_client.h index 9b18ed6..009c304 100644 --- a/frameworks/inputmethod_controller/include/i_input_client.h +++ b/frameworks/inputmethod_controller/include/i_input_client.h @@ -41,6 +41,6 @@ namespace MiscServices { virtual int32_t onInputReleased(int32_t retValue) = 0; virtual int32_t setDisplayMode(int32_t mode) = 0; }; -} -} -#endif // FM_IMMS_PROJECT_IINPUTCLIENT_H \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_I_INPUT_CLIENT_H diff --git a/frameworks/inputmethod_controller/include/i_input_data_channel.h b/frameworks/inputmethod_controller/include/i_input_data_channel.h index 4052fc2..4916a9b 100644 --- a/frameworks/inputmethod_controller/include/i_input_data_channel.h +++ b/frameworks/inputmethod_controller/include/i_input_data_channel.h @@ -58,6 +58,6 @@ namespace MiscServices { virtual int32_t GetInputPattern() = 0; virtual void StopInput() = 0; }; -} -} -#endif // FM_IMMS_PROJECT_IINPUTDATACHANNEL_H +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_I_INPUT_DATA_CHANNEL_H diff --git a/frameworks/inputmethod_controller/include/input_client_proxy.h b/frameworks/inputmethod_controller/include/input_client_proxy.h index 5b2a43d..4ac5603 100644 --- a/frameworks/inputmethod_controller/include/input_client_proxy.h +++ b/frameworks/inputmethod_controller/include/input_client_proxy.h @@ -35,6 +35,6 @@ namespace MiscServices { private: static inline BrokerDelegator delegator_; }; -} -} -#endif \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_CLIENT_PROXY_H diff --git a/frameworks/inputmethod_controller/include/input_client_stub.h b/frameworks/inputmethod_controller/include/input_client_stub.h index 86348eb..d18e716 100644 --- a/frameworks/inputmethod_controller/include/input_client_stub.h +++ b/frameworks/inputmethod_controller/include/input_client_stub.h @@ -36,9 +36,10 @@ namespace MiscServices { int32_t onInputReady(const sptr& agent) override; int32_t onInputReleased(int32_t retValue) override; int32_t setDisplayMode(int32_t mode) override; + private: MessageHandler *msgHandler = nullptr; }; -} -} -#endif \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_CLIENT_STUB_H diff --git a/frameworks/inputmethod_controller/include/input_data_channel_proxy.h b/frameworks/inputmethod_controller/include/input_data_channel_proxy.h index d5708ba..78a43e5 100644 --- a/frameworks/inputmethod_controller/include/input_data_channel_proxy.h +++ b/frameworks/inputmethod_controller/include/input_data_channel_proxy.h @@ -44,6 +44,6 @@ namespace MiscServices { private: static inline BrokerDelegator delegator_; }; -} -} -#endif \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_DATA_CHANNEL_PROXY_H diff --git a/frameworks/inputmethod_controller/include/input_data_channel_stub.h b/frameworks/inputmethod_controller/include/input_data_channel_stub.h index 9f860db..3bf4999 100644 --- a/frameworks/inputmethod_controller/include/input_data_channel_stub.h +++ b/frameworks/inputmethod_controller/include/input_data_channel_stub.h @@ -48,9 +48,10 @@ namespace MiscServices { int32_t GetEnterKeyType() override; int32_t GetInputPattern() override; void StopInput() override; + private: MessageHandler *msgHandler; }; -} -} -#endif \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_DATA_CHANNEL_STUB_H diff --git a/frameworks/inputmethod_controller/include/input_method_controller.h b/frameworks/inputmethod_controller/include/input_method_controller.h index 8acfdfe..0cc6e2e 100644 --- a/frameworks/inputmethod_controller/include/input_method_controller.h +++ b/frameworks/inputmethod_controller/include/input_method_controller.h @@ -71,6 +71,7 @@ namespace MiscServices { int32_t GetEnterKeyType(); int32_t GetInputPattern(); void HideCurrentInput(); + private: InputMethodController(); ~InputMethodController(); @@ -106,6 +107,6 @@ namespace MiscServices { int32_t enterKeyType_ = 0; int32_t inputPattern_ = 0; }; -} -} -#endif \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_METHOD_CONTROLLER_H diff --git a/frameworks/inputmethod_controller/include/input_method_system_ability_proxy.h b/frameworks/inputmethod_controller/include/input_method_system_ability_proxy.h index 4a1536a..9f091ff 100644 --- a/frameworks/inputmethod_controller/include/input_method_system_ability_proxy.h +++ b/frameworks/inputmethod_controller/include/input_method_system_ability_proxy.h @@ -36,12 +36,12 @@ namespace MiscServices { ~InputMethodSystemAbilityProxy() = default; DISALLOW_COPY_AND_MOVE(InputMethodSystemAbilityProxy); - virtual void prepareInput(MessageParcel& data) override; - virtual void releaseInput(MessageParcel& data) override; - virtual void startInput(MessageParcel& data) override; - virtual void stopInput(MessageParcel& data) override; - virtual void SetCoreAndAgent(MessageParcel& data) override; - virtual void HideCurrentInput(MessageParcel& data) override; + void prepareInput(MessageParcel& data) override; + void releaseInput(MessageParcel& data) override; + void startInput(MessageParcel& data) override; + void stopInput(MessageParcel& data) override; + void SetCoreAndAgent(MessageParcel& data) override; + void HideCurrentInput(MessageParcel& data) override; int32_t Prepare(int32_t displayId, sptr &client, sptr &channel, InputAttribute &attribute); @@ -49,17 +49,17 @@ namespace MiscServices { int32_t Start(sptr &client); int32_t Stop(sptr &client); - virtual void displayOptionalInputMethod(MessageParcel& data) override; - virtual int32_t getDisplayMode(int32_t retMode) override; - virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override; - virtual int32_t getCurrentKeyboardType(KeyboardType *retType) override; - virtual int32_t listInputMethodEnabled(std::vector *properties) override; - virtual int32_t listInputMethod(std::vector *properties) override; - virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector *types) override; + void displayOptionalInputMethod(MessageParcel& data) override; + int32_t getDisplayMode(int32_t retMode) override; + int32_t getKeyboardWindowHeight(int32_t retHeight) override; + int32_t getCurrentKeyboardType(KeyboardType *retType) override; + int32_t listInputMethodEnabled(std::vector *properties) override; + int32_t listInputMethod(std::vector *properties) override; + int32_t listKeyboardType(const std::u16string& imeId, std::vector *types) override; private: static inline BrokerDelegator delegator_; }; -} -} -#endif \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_METHOD_SYSTEM_ABILITY_PROXY_H diff --git a/frameworks/inputmethod_controller/include/input_method_utils.h b/frameworks/inputmethod_controller/include/input_method_utils.h index 54e9afe..24be150 100644 --- a/frameworks/inputmethod_controller/include/input_method_utils.h +++ b/frameworks/inputmethod_controller/include/input_method_utils.h @@ -93,10 +93,12 @@ namespace MiscServices { HIDE, SHOW }; + enum class FunctionKey { NONE = 0, CONFIRM }; + class KeyboardInfo { public: KeyboardStatus GetKeyboardStatus() const @@ -118,10 +120,11 @@ namespace MiscServices { { functionKey = static_cast(key); } + private: KeyboardStatus keyboardStatus = KeyboardStatus::NONE; FunctionKey functionKey = FunctionKey::NONE; }; -} -} -#endif // FM_IMC_PROJECT_INPUT_METHOD_UTILS_H +} // namespace MiscServices +} // namespace OHOS +#endif // FRAMEWORKS_INPUTMETHOD_CONTROLLER_INCLUDE_INPUT_METHOD_UTILS_H diff --git a/frameworks/inputmethod_controller/src/input_client_proxy.cpp b/frameworks/inputmethod_controller/src/input_client_proxy.cpp index 5e8bada..d3c6a03 100644 --- a/frameworks/inputmethod_controller/src/input_client_proxy.cpp +++ b/frameworks/inputmethod_controller/src/input_client_proxy.cpp @@ -63,5 +63,5 @@ using namespace ErrorCode; auto status = Remote()->SendRequest(SET_DISPLAY_MODE, data, reply, option); return status; } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_controller/src/input_client_stub.cpp b/frameworks/inputmethod_controller/src/input_client_stub.cpp index 40c3552..7c8ff3a 100644 --- a/frameworks/inputmethod_controller/src/input_client_stub.cpp +++ b/frameworks/inputmethod_controller/src/input_client_stub.cpp @@ -91,5 +91,5 @@ namespace MiscServices { { msgHandler = handler; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_controller/src/input_data_channel_proxy.cpp b/frameworks/inputmethod_controller/src/input_data_channel_proxy.cpp index a72fc07..860410b 100644 --- a/frameworks/inputmethod_controller/src/input_data_channel_proxy.cpp +++ b/frameworks/inputmethod_controller/src/input_data_channel_proxy.cpp @@ -177,5 +177,5 @@ namespace MiscServices { Remote()->SendRequest(STOP_INPUT, data, reply, option); } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_controller/src/input_data_channel_stub.cpp b/frameworks/inputmethod_controller/src/input_data_channel_stub.cpp index d9b9f30..74b37af 100644 --- a/frameworks/inputmethod_controller/src/input_data_channel_stub.cpp +++ b/frameworks/inputmethod_controller/src/input_data_channel_stub.cpp @@ -212,5 +212,5 @@ namespace MiscServices { { msgHandler = handler; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_controller/src/input_method_controller.cpp b/frameworks/inputmethod_controller/src/input_method_controller.cpp index 9453738..8fba7ad 100644 --- a/frameworks/inputmethod_controller/src/input_method_controller.cpp +++ b/frameworks/inputmethod_controller/src/input_method_controller.cpp @@ -420,5 +420,5 @@ using namespace MessageID; IMSA_HILOGI("InputMethodController::GetInputPattern"); return inputPattern_; } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_controller/src/input_method_system_ability_proxy.cpp b/frameworks/inputmethod_controller/src/input_method_system_ability_proxy.cpp index f004124..b61194b 100644 --- a/frameworks/inputmethod_controller/src/input_method_system_ability_proxy.cpp +++ b/frameworks/inputmethod_controller/src/input_method_system_ability_proxy.cpp @@ -437,5 +437,5 @@ namespace MiscServices { } return NO_ERROR; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/frameworks/inputmethod_controller/src/input_method_utils.cpp b/frameworks/inputmethod_controller/src/input_method_utils.cpp index c3659bc..b0b8f7c 100644 --- a/frameworks/inputmethod_controller/src/input_method_utils.cpp +++ b/frameworks/inputmethod_controller/src/input_method_utils.cpp @@ -15,6 +15,5 @@ #include "input_method_utils.h" namespace OHOS { namespace MiscServices { -} -} - +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethod/include/js_input_method_controller.h b/interfaces/kits/js/napi/inputmethod/include/js_input_method_controller.h index 9ff62ba..e2229f6 100644 --- a/interfaces/kits/js/napi/inputmethod/include/js_input_method_controller.h +++ b/interfaces/kits/js/napi/inputmethod/include/js_input_method_controller.h @@ -28,9 +28,10 @@ namespace OHOS { static void Finalizer(NativeEngine *engine, void *data, void *hint); static NativeValue* StopInput(NativeEngine* engine, NativeCallbackInfo* info); + private: NativeValue* OnStopInput(NativeEngine& engine, NativeCallbackInfo& info); }; - } -} -#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_SETTING_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHOD_INCLUDE_JS_INPUT_METHOD_CONTROLLER_H diff --git a/interfaces/kits/js/napi/inputmethod/include/js_input_method_registry.h b/interfaces/kits/js/napi/inputmethod/include/js_input_method_registry.h index 3d089a7..43fdc2b 100644 --- a/interfaces/kits/js/napi/inputmethod/include/js_input_method_registry.h +++ b/interfaces/kits/js/napi/inputmethod/include/js_input_method_registry.h @@ -26,7 +26,7 @@ namespace OHOS { namespace MiscServices { NativeValue* JsInputMethodRegistryInit(NativeEngine* engine, NativeValue* exportObj); - } -} + } // namespace MiscServices +} // namespace OHOS -#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_REGISTRY_H \ No newline at end of file +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHOD_INCLUDE_JS_INPUT_METHOD_REGISTRY_H diff --git a/interfaces/kits/js/napi/inputmethod/include/js_input_method_setting.h b/interfaces/kits/js/napi/inputmethod/include/js_input_method_setting.h index 040fda6..14a3ac0 100644 --- a/interfaces/kits/js/napi/inputmethod/include/js_input_method_setting.h +++ b/interfaces/kits/js/napi/inputmethod/include/js_input_method_setting.h @@ -29,10 +29,11 @@ namespace OHOS { static void Finalizer(NativeEngine *engine, void *data, void *hint); static NativeValue* DisplayOptionalInputMethod(NativeEngine* engine, NativeCallbackInfo* info); static NativeValue* ListInputMethod(NativeEngine* engine, NativeCallbackInfo* info); + private: NativeValue* OnDisplayOptionalInputMethod(NativeEngine& engine, NativeCallbackInfo& info); NativeValue* OnListInputMethod(NativeEngine& engine, NativeCallbackInfo& info); }; - } -} -#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_SETTING_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHOD_INCLUDE_JS_INPUT_METHOD_SETTING_H diff --git a/interfaces/kits/js/napi/inputmethod/include/js_input_method_utils.h b/interfaces/kits/js/napi/inputmethod/include/js_input_method_utils.h index 5fee57a..76f3b67 100644 --- a/interfaces/kits/js/napi/inputmethod/include/js_input_method_utils.h +++ b/interfaces/kits/js/napi/inputmethod/include/js_input_method_utils.h @@ -24,6 +24,6 @@ namespace OHOS { namespace MiscServices { NativeValue *CreateInputMethodSetting(NativeEngine& engine); NativeValue *CreateInputMethodController(NativeEngine& engine); - } -} -#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_SETTING_UTILS_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHOD_INCLUDE_JS_INPUT_METHOD_UTILS_H diff --git a/interfaces/kits/js/napi/inputmethod/src/input_method_module.cpp b/interfaces/kits/js/napi/inputmethod/src/input_method_module.cpp index 5d9d1dc..09bfd44 100644 --- a/interfaces/kits/js/napi/inputmethod/src/input_method_module.cpp +++ b/interfaces/kits/js/napi/inputmethod/src/input_method_module.cpp @@ -26,4 +26,4 @@ extern "C" __attribute__((constructor)) void NAPI_inputMethod_AutoRegister() }; moduleManager->Register(&newModuleInfo); -} \ No newline at end of file +} diff --git a/interfaces/kits/js/napi/inputmethod/src/js_input_method_controller.cpp b/interfaces/kits/js/napi/inputmethod/src/js_input_method_controller.cpp index 7e0c606..889f1eb 100644 --- a/interfaces/kits/js/napi/inputmethod/src/js_input_method_controller.cpp +++ b/interfaces/kits/js/napi/inputmethod/src/js_input_method_controller.cpp @@ -50,5 +50,5 @@ namespace MiscServices { return result; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethod/src/js_input_method_registry.cpp b/interfaces/kits/js/napi/inputmethod/src/js_input_method_registry.cpp index 3c5911f..e6c5d4a 100644 --- a/interfaces/kits/js/napi/inputmethod/src/js_input_method_registry.cpp +++ b/interfaces/kits/js/napi/inputmethod/src/js_input_method_registry.cpp @@ -107,5 +107,5 @@ namespace MiscServices { return engine->CreateUndefined(); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethod/src/js_input_method_setting.cpp b/interfaces/kits/js/napi/inputmethod/src/js_input_method_setting.cpp index f89bc61..71c41eb 100644 --- a/interfaces/kits/js/napi/inputmethod/src/js_input_method_setting.cpp +++ b/interfaces/kits/js/napi/inputmethod/src/js_input_method_setting.cpp @@ -84,5 +84,5 @@ namespace MiscServices { return arrayValue; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethod/src/js_input_method_utils.cpp b/interfaces/kits/js/napi/inputmethod/src/js_input_method_utils.cpp index 231afaf..5e641f4 100644 --- a/interfaces/kits/js/napi/inputmethod/src/js_input_method_utils.cpp +++ b/interfaces/kits/js/napi/inputmethod/src/js_input_method_utils.cpp @@ -57,5 +57,5 @@ namespace OHOS { BindNativeFunction(engine, *object, "stopInput", JsInputMethodController::StopInput); return objValue; } - } -} \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_editor_attribute.h b/interfaces/kits/js/napi/inputmethodengine/include/js_editor_attribute.h index 308cb34..123aa40 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_editor_attribute.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_editor_attribute.h @@ -25,8 +25,7 @@ namespace OHOS { JsEditorAttribute() = default; ~JsEditorAttribute() = default; static void Finalizer(NativeEngine* engine, void* data, void* hint); - private: }; - } -} -#endif // OHOS_MISCSERVICES_JS_EDITOR_ATTRIBUTE_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_EDITOR_ATTRIBUTE_H diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine.h b/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine.h index 2b0f336..7aa29fc 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine.h @@ -30,6 +30,7 @@ namespace OHOS { static void Finalizer(NativeEngine* engine, void* data, void* hint); static NativeValue* RegisterCallback(NativeEngine* engine, NativeCallbackInfo* info); static NativeValue* UnRegisterCallback(NativeEngine* engine, NativeCallbackInfo* info); + private: sptr imeListener_; std::mutex mtx_; @@ -38,6 +39,6 @@ namespace OHOS { std::shared_ptr GetMainHandler(); std::shared_ptr mainHandler_ = nullptr; }; - } -} -#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_ENGINE_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_INPUT_METHOD_ENGINE_H diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_listener.h b/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_listener.h index 37bc588..c4bdc37 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_listener.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_listener.h @@ -39,6 +39,7 @@ namespace MiscServices { void OnKeyboardStatus(bool isShow); void OnInputStart(); void OnInputStop(std::string imeId); + private: void AddCallback(std::string type, NativeValue* jsListenerObject); void CallJsMethod(std::string methodName, NativeValue* const* argv = nullptr, size_t argc = 0); @@ -50,6 +51,6 @@ namespace MiscServices { std::map>> jsCbMap_; std::shared_ptr mainHandler_ = nullptr; }; -} -} -#endif // FM_IMMS_PROJECT_JS_INPUT_METHOD_ENGINE_LISTENER_H +} // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_INPUT_METHOD_ENGINE_LISTENER_H diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_registry.h b/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_registry.h index 337ca6f..5fa1cad 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_registry.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_registry.h @@ -27,7 +27,7 @@ namespace OHOS { namespace MiscServices { NativeValue* JsInputMethodEngineRegistryInit(NativeEngine* engine, NativeValue* exportObj); - } -} + } // namespace MiscServices +} // namespace OHOS -#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_ENGINE_REGISTRY_H \ No newline at end of file +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_INPUT_METHOD_ENGINE_REGISTRY_H diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_utils.h b/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_utils.h index 9fea1cd..bfb7c0e 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_utils.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_input_method_engine_utils.h @@ -32,6 +32,6 @@ namespace OHOS { NativeValue *CreateTextInputClient(NativeEngine& engine); NativeValue *CreateKeyboardDelegate(NativeEngine& engine); NativeValue *CreateEditorAttribute(NativeEngine& engine); - } -} -#endif // OHOS_MISCSERVICES_JS_INPUT_METHOD_ENGINE_UTILS_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_INPUT_METHOD_UTILS_H diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_controller.h b/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_controller.h index d9cd700..7ad9dc8 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_controller.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_controller.h @@ -26,9 +26,10 @@ namespace OHOS { ~JsKeyboardController() = default; static void Finalizer(NativeEngine* engine, void* data, void* hint); static NativeValue* HideKeyboardSelf(NativeEngine* engine, NativeCallbackInfo* info); + private: NativeValue* OnHideKeyboardSelf(NativeEngine& engine, NativeCallbackInfo& info); }; - } -} -#endif // OHOS_MISCSERVICES_JS_KEYBOARD_CONTROLLER_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_KEYBOARD_CONTROLLER_H diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_delegate.h b/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_delegate.h index 388f084..3305b06 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_delegate.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_delegate.h @@ -32,6 +32,7 @@ namespace OHOS { static void Finalizer(NativeEngine* engine, void* data, void* hint); static NativeValue* RegisterCallback(NativeEngine* engine, NativeCallbackInfo* info); static NativeValue* UnRegisterCallback(NativeEngine* engine, NativeCallbackInfo* info); + private: sptr kdListener_; std::mutex mtx_; @@ -40,6 +41,6 @@ namespace OHOS { std::shared_ptr GetMainHandler(); std::shared_ptr mainHandler_ = nullptr; }; - } -} -#endif // OHOS_MISCSERVICES_JS_KEYBOARD_DELEGATE_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_KEYBOARD_DELEGATE_H diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_delegate_listener.h b/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_delegate_listener.h index 8fc3cd5..dc07ceb 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_delegate_listener.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_keyboard_delegate_listener.h @@ -40,6 +40,7 @@ namespace MiscServices { void OnCursorUpdate(int32_t positionX, int32_t positionY, int height); void OnSelectionChange(int32_t oldBegin, int32_t oldEnd, int32_t newBegin, int32_t newEnd); void OnTextChange(std::string text); + private: void AddCallback(std::string type, NativeValue* jsListenerObject); void CallJsMethod(std::string methodName, NativeValue* const* argv = nullptr, size_t argc = 0); @@ -51,6 +52,6 @@ namespace MiscServices { std::map>> jsCbMap_; std::shared_ptr mainHandler_ = nullptr; }; -} -} -#endif // FM_IMMS_PROJECT_JS_KEYBOARD_DELEGATE_LISTENER_H +} // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_KEYBOARD_DELEGATE_LISTENER_H diff --git a/interfaces/kits/js/napi/inputmethodengine/include/js_text_input_client.h b/interfaces/kits/js/napi/inputmethodengine/include/js_text_input_client.h index e14701a..d52fa78 100644 --- a/interfaces/kits/js/napi/inputmethodengine/include/js_text_input_client.h +++ b/interfaces/kits/js/napi/inputmethodengine/include/js_text_input_client.h @@ -32,6 +32,7 @@ namespace OHOS { static NativeValue* GetForward(NativeEngine* engine, NativeCallbackInfo* info); static NativeValue* GetBackward(NativeEngine* engine, NativeCallbackInfo* info); static NativeValue* GetEditorAttribute(NativeEngine* engine, NativeCallbackInfo* info); + private: NativeValue* OnInsertText(NativeEngine& engine, NativeCallbackInfo& info); NativeValue* OnDeleteForward(NativeEngine& engine, NativeCallbackInfo& info); @@ -41,6 +42,6 @@ namespace OHOS { NativeValue* OnGetBackward(NativeEngine& engine, NativeCallbackInfo& info); NativeValue* OnGetEditorAttribute(NativeEngine& engine, NativeCallbackInfo& info); }; - } -} -#endif // OHOS_MISCSERVICES_JS_TEXT_INPUT_CLIENT_H \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS +#endif // INTERFACE_KITS_JS_NAPI_INPUTMETHODENGINE_INCLUDE_JS_TEXT_INPUT_CLIENT_H diff --git a/interfaces/kits/js/napi/inputmethodengine/src/input_method_engine_module.cpp b/interfaces/kits/js/napi/inputmethodengine/src/input_method_engine_module.cpp index da577f5..8f5089d 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/input_method_engine_module.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/input_method_engine_module.cpp @@ -26,4 +26,4 @@ extern "C" __attribute__((constructor)) void NAPI_inputMethodEngine_AutoRegister }; moduleManager->Register(&newModuleInfo); -} \ No newline at end of file +} diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_editor_attribute.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_editor_attribute.cpp index 9612dd9..7671298 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_editor_attribute.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_editor_attribute.cpp @@ -27,5 +27,5 @@ namespace MiscServices { IMSA_HILOGI("JsEditorAttribute::Finalizer is called"); std::unique_ptr(static_cast(data)); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine.cpp index 726738a..759e30a 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine.cpp @@ -107,5 +107,5 @@ namespace MiscServices { } return engine.CreateUndefined(); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_listener.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_listener.cpp index d61a3e7..09887c0 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_listener.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_listener.cpp @@ -198,5 +198,5 @@ namespace MiscServices { }; mainHandler_->PostTask(task); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_registry.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_registry.cpp index e76fbd7..207e3a9 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_registry.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_registry.cpp @@ -170,5 +170,5 @@ namespace MiscServices { object->SetProperty("CURSOR_RIGHT", CreateJsValue(*engine, static_cast(4))); return engine->CreateUndefined(); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_utils.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_utils.cpp index 8a1462b..a97b2ad 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_utils.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_input_method_engine_utils.cpp @@ -122,5 +122,5 @@ namespace OHOS { return objValue; } - } -} \ No newline at end of file + } // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_controller.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_controller.cpp index afee607..4f2c7e9 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_controller.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_controller.cpp @@ -48,5 +48,5 @@ namespace MiscServices { return engine.CreateUndefined(); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_delegate.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_delegate.cpp index 7b51b6d..74f4640 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_delegate.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_delegate.cpp @@ -108,5 +108,5 @@ namespace MiscServices { } return engine.CreateUndefined(); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_delegate_listener.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_delegate_listener.cpp index 5427c42..0d6985f 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_delegate_listener.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_keyboard_delegate_listener.cpp @@ -223,5 +223,5 @@ namespace MiscServices { mainHandler_->PostTask(task); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/interfaces/kits/js/napi/inputmethodengine/src/js_text_input_client.cpp b/interfaces/kits/js/napi/inputmethodengine/src/js_text_input_client.cpp index e13ab70..5bd9bef 100644 --- a/interfaces/kits/js/napi/inputmethodengine/src/js_text_input_client.cpp +++ b/interfaces/kits/js/napi/inputmethodengine/src/js_text_input_client.cpp @@ -229,5 +229,5 @@ namespace MiscServices { return CreateEditorAttribute(engine); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/include/global.h b/services/include/global.h index 353e550..9b45a63 100644 --- a/services/include/global.h +++ b/services/include/global.h @@ -62,7 +62,7 @@ namespace CommonEvent { COMMON_EVENT_PACKAGE_ADDED = 10006, // a package is installed. COMMON_EVENT_PACKAGE_REMOVED = 10007, // a package is removed }; -}; +}; // namespace CommonEvent // User State namespace UserState { @@ -72,7 +72,7 @@ namespace UserState { USER_STATE_STARTED = 0, // a user is started. USER_STATE_UNLOCKED, // a user is unlocked. }; -}; +}; // namespace UserState // Error Code namespace ErrorCode { @@ -147,7 +147,7 @@ namespace ErrorCode { ERROR_CLIENT_NOT_FOUND, // client is not found }; const char* ToString(int errorCode); -}; +}; // namespace ErrorCode static constexpr HiviewDFX::HiLogLabel g_SMALL_SERVICES_LABEL = { LOG_CORE, @@ -167,4 +167,4 @@ static constexpr HiviewDFX::HiLogLabel g_SMALL_SERVICES_LABEL = { "line: %d, function: %s," fmt, __LINE__, __FUNCTION__, ##__VA_ARGS__) } } -#endif // FM_IMMS_PROJECT_GLOBAL_H +#endif // SERVICES_INCLUDE_GLOBAL_H diff --git a/services/include/i_input_control_channel.h b/services/include/i_input_control_channel.h index 7fd71af..653ff5b 100644 --- a/services/include/i_input_control_channel.h +++ b/services/include/i_input_control_channel.h @@ -39,6 +39,6 @@ namespace OHOS { virtual void setDisplayMode(int mode) = 0; virtual void onKeyboardShowed() = 0; }; - } -} -#endif // FM_IMMS_PROJECT_IINPUTCONTROLCHANNEL_H + } // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_I_INPUT_CONTROL_CHANNEL_H diff --git a/services/include/i_input_method_system_ability.h b/services/include/i_input_method_system_ability.h index d688d98..9511baf 100644 --- a/services/include/i_input_method_system_ability.h +++ b/services/include/i_input_method_system_ability.h @@ -66,6 +66,6 @@ namespace MiscServices { virtual int32_t listInputMethod(std::vector *properties) = 0; virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector *types) = 0; }; -} -} -#endif // FM_IMMS_PROJECT_IINPUTMETHODSYSTEMABILITY_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H diff --git a/services/include/i_platform_api.h b/services/include/i_platform_api.h index 006b039..b9ab913 100644 --- a/services/include/i_platform_api.h +++ b/services/include/i_platform_api.h @@ -57,6 +57,6 @@ namespace OHOS { virtual int32_t getInputMethodSetting(int userId, InputMethodSetting *inputMethodSetting) = 0; virtual int32_t setInputMethodSetting(int userId, const InputMethodSetting& inputMethodSetting) = 0; }; -} -} -#endif // FM_IMMS_PROJECT_IPLATFORMAPI_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_I_PLATFORM_API_H diff --git a/services/include/i_platform_callback.h b/services/include/i_platform_callback.h index 2c94b53..4b79db7 100644 --- a/services/include/i_platform_callback.h +++ b/services/include/i_platform_callback.h @@ -34,6 +34,6 @@ namespace MiscServices { virtual void notifyEvent(int eventId, int userId, const std::vector& eventContent) = 0; }; -} -} -#endif // FM_IMMS_PROJECT_IPLATFORMCALLBACK_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_I_PLATFORM_CALLBACK_H diff --git a/services/include/im_common_event_manager.h b/services/include/im_common_event_manager.h index 391317f..14e7741 100644 --- a/services/include/im_common_event_manager.h +++ b/services/include/im_common_event_manager.h @@ -46,4 +46,4 @@ private: }; } // namespace MiscServices } // namespace OHOS -#endif // FM_IMMS_PROJECT_IPLATFORMCALLBACK_H +#endif // SERVICES_INCLUDE_IM_COMMON_EVENT_MANAGER_H diff --git a/services/include/input_attribute.h b/services/include/input_attribute.h index a291239..36f4f29 100644 --- a/services/include/input_attribute.h +++ b/services/include/input_attribute.h @@ -25,18 +25,19 @@ namespace MiscServices { InputAttribute(const InputAttribute& attribute); InputAttribute& operator =(const InputAttribute& attribute); ~InputAttribute(); - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; static InputAttribute *Unmarshalling(Parcel &parcel); void SetInputPattern(int32_t pattern); bool GetSecurityFlag(); static const int32_t PATTERN_TEXT = 0x00000001; static const int32_t PATTERN_PASSWORD = 0x00000007; + private: int32_t inputPattern; int32_t enterKeyType; int32_t inputOption; }; -} -} +} // namespace MiscServices +} // namespace OHOS -#endif // FM_IMMS_PROJECT_INPUTATTRIBUTE_H +#endif // SERVICES_INCLUDE_INPUT_ATTRIBUTE_H diff --git a/services/include/input_channel.h b/services/include/input_channel.h index c22a79d..43f15c5 100644 --- a/services/include/input_channel.h +++ b/services/include/input_channel.h @@ -26,14 +26,15 @@ namespace MiscServices { public: InputChannel(); ~InputChannel(); - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; static InputChannel *Unmarshalling(Parcel &parcel); + private: std::u16string name; MessageParcel inputChannelParcel; InputChannel(const InputChannel& channel); InputChannel& operator =(const InputChannel& channel); }; -} -} -#endif // INPUTMETHODSYSTEMSERVICE_INPUTCHANNEL_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_INPUT_CHANNEL_H diff --git a/services/include/input_control_channel_proxy.h b/services/include/input_control_channel_proxy.h index fca5377..aa85bda 100644 --- a/services/include/input_control_channel_proxy.h +++ b/services/include/input_control_channel_proxy.h @@ -33,11 +33,11 @@ namespace MiscServices { InputControlChannelProxy(const sptr &impl); ~InputControlChannelProxy(); - virtual void hideKeyboardSelf(int flags) override; - virtual bool advanceToNext(bool isCurrentIme) override; - virtual void setDisplayMode(int mode) override; - virtual void onKeyboardShowed() override; + void hideKeyboardSelf(int flags) override; + bool advanceToNext(bool isCurrentIme) override; + void setDisplayMode(int mode) override; + void onKeyboardShowed() override; }; -} -} -#endif // FM_IMMS_PROJECT_INPUTCONTROLCHANNELPROXY_H \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_INPUT_CONTROL_CHANNEL_PROXY_H diff --git a/services/include/input_control_channel_stub.h b/services/include/input_control_channel_stub.h index 15ea287..dd52ac0 100644 --- a/services/include/input_control_channel_stub.h +++ b/services/include/input_control_channel_stub.h @@ -31,17 +31,18 @@ namespace OHOS { public: explicit InputControlChannelStub(int userId); virtual ~InputControlChannelStub(); - virtual int OnRemoteRequest(uint32_t code, + int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual void hideKeyboardSelf(int flags) override; - virtual bool advanceToNext(bool isCurrentIme) override; - virtual void setDisplayMode(int mode) override; - virtual void onKeyboardShowed() override; + void hideKeyboardSelf(int flags) override; + bool advanceToNext(bool isCurrentIme) override; + void setDisplayMode(int mode) override; + void onKeyboardShowed() override; void ResetFlag(); bool WaitKeyboardReady(); + private: int userId_; @@ -51,6 +52,6 @@ namespace OHOS { bool keyboardReadyFlag = false; const int32_t sleepTime = 300; }; -} -} -#endif // FM_IMMS_PROJECT_INPUTCONTROLCHANNELSTUB_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_INPUT_CONTROL_CHANNEL_STUB_H diff --git a/services/include/input_method_ability_connection_stub.h b/services/include/input_method_ability_connection_stub.h index e749eda..295c533 100644 --- a/services/include/input_method_ability_connection_stub.h +++ b/services/include/input_method_ability_connection_stub.h @@ -41,6 +41,6 @@ namespace MiscServices { MessageHandler *messageHandler; int mIndex; }; -} -} -#endif // SERVICES_INPUTMETHODABILITYCONNECTIONSTUB_H \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_INPUT_METHOD_ABILITY_CONNECTION_STUB_H diff --git a/services/include/input_method_property.h b/services/include/input_method_property.h index c87be3e..da0e5f7 100644 --- a/services/include/input_method_property.h +++ b/services/include/input_method_property.h @@ -40,9 +40,9 @@ namespace MiscServices { ~InputMethodProperty(); InputMethodProperty(const InputMethodProperty& property); InputMethodProperty& operator =(const InputMethodProperty& property); - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; static InputMethodProperty *Unmarshalling(Parcel &parcel); }; -} -} -#endif // FM_IMMS_PROJECT_INPUTMETHODPROPERTY_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_INPUT_METHOD_PROPERTY_H diff --git a/services/include/input_method_setting.h b/services/include/input_method_setting.h index 0594a12..5ede921 100644 --- a/services/include/input_method_setting.h +++ b/services/include/input_method_setting.h @@ -55,7 +55,7 @@ namespace MiscServices { void ClearData(); bool FindKey(const std::u16string& key) const; - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; static InputMethodSetting *Unmarshalling(Parcel &parcel); private: @@ -65,6 +65,6 @@ namespace MiscServices { std::vector Split(const std::u16string& str, char16_t delim); std::u16string BuildString(const std::vector& vector, char16_t delim); }; -} -} -#endif // FM_IMMS_PROJECT_INPUTMETHODSETTING_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_INPUT_METHOD_SETTING_H diff --git a/services/include/input_method_system_ability.h b/services/include/input_method_system_ability.h index 01beb52..12940fc 100644 --- a/services/include/input_method_system_ability.h +++ b/services/include/input_method_system_ability.h @@ -47,16 +47,18 @@ namespace MiscServices { int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual int32_t getDisplayMode(int32_t retMode) override; - virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override; - virtual int32_t getCurrentKeyboardType(KeyboardType *retType) override; - virtual int32_t listInputMethodEnabled(std::vector *properties) override; - virtual int32_t listInputMethod(std::vector *properties) override; - virtual int32_t listInputMethodByUserId(int32_t userId, std::vector *properties) override; - virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector *types) override; + int32_t getDisplayMode(int32_t retMode) override; + int32_t getKeyboardWindowHeight(int32_t retHeight) override; + int32_t getCurrentKeyboardType(KeyboardType *retType) override; + int32_t listInputMethodEnabled(std::vector *properties) override; + int32_t listInputMethod(std::vector *properties) override; + int32_t listInputMethodByUserId(int32_t userId, std::vector *properties) override; + int32_t listKeyboardType(const std::u16string& imeId, std::vector *types) override; + protected: void OnStart() override; void OnStop() override; + private: int32_t Init(); void Initialize(); @@ -96,6 +98,6 @@ namespace MiscServices { static std::shared_ptr serviceHandler_; int32_t userId_; }; -} -} -#endif // FM_IMMS_PROJECT_INPUTMETHODSYSTEMABILITY_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_INPUT_METHOD_SYSTEM_ABILITY_H diff --git a/services/include/input_method_system_ability_stub.h b/services/include/input_method_system_ability_stub.h index df92a02..7e6e91f 100644 --- a/services/include/input_method_system_ability_stub.h +++ b/services/include/input_method_system_ability_stub.h @@ -29,19 +29,20 @@ namespace MiscServices { int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual void prepareInput(MessageParcel& data) override; - virtual void releaseInput(MessageParcel& data) override; - virtual void startInput(MessageParcel& data) override; - virtual void stopInput(MessageParcel& data) override; - virtual void SetCoreAndAgent(MessageParcel& data) override; - virtual void HideCurrentInput(MessageParcel& data) override; - virtual void displayOptionalInputMethod(MessageParcel& data) override; + void prepareInput(MessageParcel& data) override; + void releaseInput(MessageParcel& data) override; + void startInput(MessageParcel& data) override; + void stopInput(MessageParcel& data) override; + void SetCoreAndAgent(MessageParcel& data) override; + void HideCurrentInput(MessageParcel& data) override; + void displayOptionalInputMethod(MessageParcel& data) override; virtual int32_t listInputMethodByUserId(int32_t userId, std::vector *properties) = 0; + protected: int32_t getUserId(int32_t uid); int USER_ID_CHANGE_VALUE = 200000; // user range }; -} -} +} // namespace MiscServices +} // namespace OHOS -#endif // FM_IMMS_PROJECT_INPUTMETHODSYSTEMABILITY_SK_H +#endif // SERVICES_INCLUDE_INPUT_METHOD_SYSTEM_ABILITY_STUB_H diff --git a/services/include/keyboard_type.h b/services/include/keyboard_type.h index abd5b8e..9d14aeb 100644 --- a/services/include/keyboard_type.h +++ b/services/include/keyboard_type.h @@ -28,7 +28,7 @@ namespace MiscServices { KeyboardType(const KeyboardType& type); ~KeyboardType(); KeyboardType& operator =(const KeyboardType& type); - virtual bool Marshalling(Parcel &parcel) const override; + bool Marshalling(Parcel &parcel) const override; static KeyboardType *Unmarshalling(Parcel &parcel); void setId(int32_t typeId); void setLabelId(int32_t labelId); @@ -58,6 +58,6 @@ namespace MiscServices { const int32_t ID_NONE = 0; }; -} -} -#endif // FM_IMMS_PROJECT_KEYBOARDTYPE_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_KEYBOARD_TYPE_H diff --git a/services/include/message.h b/services/include/message.h index 9f7cc3a..8073b49 100644 --- a/services/include/message.h +++ b/services/include/message.h @@ -29,11 +29,12 @@ namespace MiscServices { explicit Message(const Message& msg); Message& operator =(const Message& msg); ~Message(); + private: Message(const Message&&); Message& operator =(const Message&&); }; -} -} +} // namespace MiscServices +} // namespace OHOS -#endif // FM_IMMS_PROJECT_MESSAGE_H \ No newline at end of file +#endif // SERVICES_INCLUDE_MESSAGE_H diff --git a/services/include/message_handler.h b/services/include/message_handler.h index 9d05044..672374e 100644 --- a/services/include/message_handler.h +++ b/services/include/message_handler.h @@ -104,6 +104,6 @@ namespace MessageID { MessageHandler(const MessageHandler&&); MessageHandler& operator =(const MessageHandler&&); }; -} -} -#endif // FM_IMMS_PROJECT_MESSAGEHANDLER_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_MESSAGE_HANDLER_H diff --git a/services/include/peruser_session.h b/services/include/peruser_session.h index c9e470c..936373a 100644 --- a/services/include/peruser_session.h +++ b/services/include/peruser_session.h @@ -46,6 +46,7 @@ namespace MiscServices { RemoteObjectDeathRecipient(int userId, int msgId); ~RemoteObjectDeathRecipient(); void OnRemoteDied(const wptr& who) override; + private: int userId_; // the id of the user to whom the object is linking int msgId_; // the message id can be MessageID::MSG_ID_CLIENT_DIED and MessageID::MSG_ID_IMS_DIED @@ -114,6 +115,7 @@ namespace MiscServices { void JoinWorkThread(); void StopInputService(std::string imeId); static bool StartInputService(); + private: int userId_; // the id of the user to whom the object is linking int userState; // the state of the user to whom the object is linking @@ -186,6 +188,6 @@ namespace MiscServices { void InitInputControlChannel(); void SendAgentToAllClients(); }; -} -} -#endif // FM_IMMS_PROJECT_PERUSERSESSION_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_PERUSER_SESSION_H diff --git a/services/include/peruser_setting.h b/services/include/peruser_setting.h index 28e1a55..e73b82f 100644 --- a/services/include/peruser_setting.h +++ b/services/include/peruser_setting.h @@ -69,6 +69,6 @@ namespace MiscServices { std::u16string GetKeyboardTypeLanguage(const InputMethodProperty *property, int32_t hashCode); std::u16string GetImeId(const std::u16string& packageName); }; -} -} -#endif // FM_IMMS_PROJECT_PERUSERSETTING_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_PERUSER_SETTING_H diff --git a/services/include/platform.h b/services/include/platform.h index 15c64ca..227bde4 100644 --- a/services/include/platform.h +++ b/services/include/platform.h @@ -60,6 +60,6 @@ namespace MiscServices { Platform(const Platform&&); Platform& operator =(const Platform&&); }; -} -} -#endif // FM_IMMS_PROJECT_PLATFORMAPI_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_PLATFORM_H diff --git a/services/include/platform_callback_stub.h b/services/include/platform_callback_stub.h index b20b514..a0cff16 100644 --- a/services/include/platform_callback_stub.h +++ b/services/include/platform_callback_stub.h @@ -29,10 +29,10 @@ namespace MiscServices { PlatformCallbackStub(); ~PlatformCallbackStub(); - virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, + int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - virtual void notifyEvent(int eventId, int userId, const std::vector& eventContent) override; + void notifyEvent(int eventId, int userId, const std::vector& eventContent) override; }; -} -} -#endif // FM_IMMS_PROJECT_PLATFORMCALLBACK_SK_H +} // namespace MiscServices +} // namespace OHOS +#endif // SERVICES_INCLUDE_PLATFORM_CALLBACK_STUB_H diff --git a/services/include/utils.h b/services/include/utils.h index ce73212..2c43c4b 100644 --- a/services/include/utils.h +++ b/services/include/utils.h @@ -36,7 +36,7 @@ namespace MiscServices { return std::wstring_convert, char16_t> {}.from_bytes(str); } }; -} -} +} // namespace MiscServices +} // namespace OHOS -#endif \ No newline at end of file +#endif // SERVICES_INCLUDE_UTILS_H diff --git a/services/src/global.cpp b/services/src/global.cpp index 7db5989..1dad76f 100644 --- a/services/src/global.cpp +++ b/services/src/global.cpp @@ -216,7 +216,6 @@ namespace MiscServices { } return "error is out of definition"; }; - } -} -} - + } // namespace ErrorCode +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/im_common_event_manager.cpp b/services/src/im_common_event_manager.cpp index 462291e..31a628c 100644 --- a/services/src/im_common_event_manager.cpp +++ b/services/src/im_common_event_manager.cpp @@ -100,5 +100,5 @@ namespace MiscServices { MessageHandler::Instance()->SendMessage(msg); IMSA_HILOGI("ImCommonEventManager::startUser 3"); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_attribute.cpp b/services/src/input_attribute.cpp index e739e81..dfdc64d 100644 --- a/services/src/input_attribute.cpp +++ b/services/src/input_attribute.cpp @@ -103,5 +103,5 @@ namespace MiscServices { { inputPattern = pattern; } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_channel.cpp b/services/src/input_channel.cpp index d39ea3a..0101891 100644 --- a/services/src/input_channel.cpp +++ b/services/src/input_channel.cpp @@ -58,5 +58,5 @@ namespace MiscServices { inputChannel->inputChannelParcel.RewindRead(0); return inputChannel; } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_control_channel_proxy.cpp b/services/src/input_control_channel_proxy.cpp index 8eb7edd..575cd25 100644 --- a/services/src/input_control_channel_proxy.cpp +++ b/services/src/input_control_channel_proxy.cpp @@ -82,5 +82,5 @@ namespace MiscServices { Remote()->SendRequest(ON_KEYBOARD_SHOWED, data, reply, option); IMSA_HILOGI("InputControlChannelProxy::onKeyboardShowed."); } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_control_channel_stub.cpp b/services/src/input_control_channel_stub.cpp index 7585775..c89ac73 100644 --- a/services/src/input_control_channel_stub.cpp +++ b/services/src/input_control_channel_stub.cpp @@ -182,5 +182,5 @@ namespace MiscServices { } return ret; } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_method_ability_connection_stub.cpp b/services/src/input_method_ability_connection_stub.cpp index 88dc892..20cdca4 100644 --- a/services/src/input_method_ability_connection_stub.cpp +++ b/services/src/input_method_ability_connection_stub.cpp @@ -59,5 +59,5 @@ namespace MiscServices { { messageHandler = handler; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_method_property.cpp b/services/src/input_method_property.cpp index d15f709..8d1ecc4 100644 --- a/services/src/input_method_property.cpp +++ b/services/src/input_method_property.cpp @@ -139,5 +139,5 @@ namespace MiscServices { } return info; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_method_setting.cpp b/services/src/input_method_setting.cpp index d6d0504..c833a8a 100644 --- a/services/src/input_method_setting.cpp +++ b/services/src/input_method_setting.cpp @@ -172,7 +172,7 @@ namespace MiscServices { break; } } - if (flag == false) { + if (!flag) { imeList.push_back(imeStr); } @@ -200,7 +200,7 @@ namespace MiscServices { break; } } - if (flag == true) { + if (flag) { std::u16string value = BuildString(imeList, DELIM_IME); SetValue(ENABLED_INPUT_METHODS_TAG, value); } @@ -227,7 +227,7 @@ namespace MiscServices { } } tmpVector.clear(); - if (flag == false) { + if (!flag) { return retValue; } @@ -340,5 +340,5 @@ namespace MiscServices { } return retValue; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index 7d35050..c4c3fb9 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -765,7 +765,7 @@ namespace MiscServices { IMSA_HILOGI("End...\n"); return ret; } - if (securityImeFlag == true) { + if (securityImeFlag) { InputMethodProperty *securityIme = setting->GetSecurityInputMethod(); InputMethodProperty *defaultIme = setting->GetCurrentInputMethod(); GetUserSession(userId)->ResetIme(defaultIme, securityIme); @@ -814,7 +814,7 @@ namespace MiscServices { IMSA_HILOGI("End...\n"); return ret; } - if (securityImeFlag == true) { + if (securityImeFlag) { InputMethodProperty *securityIme = setting->GetSecurityInputMethod(); InputMethodProperty *defaultIme = setting->GetCurrentInputMethod(); GetUserSession(userId)->ResetIme(defaultIme, securityIme); @@ -1019,5 +1019,5 @@ namespace MiscServices { } return iface_cast(abilityMsObj); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/input_method_system_ability_stub.cpp b/services/src/input_method_system_ability_stub.cpp index 5327981..2dd37f0 100644 --- a/services/src/input_method_system_ability_stub.cpp +++ b/services/src/input_method_system_ability_stub.cpp @@ -312,5 +312,5 @@ namespace MiscServices { { return uid / USER_ID_CHANGE_VALUE; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/keyboard_type.cpp b/services/src/keyboard_type.cpp index 237052b..45402a7 100644 --- a/services/src/keyboard_type.cpp +++ b/services/src/keyboard_type.cpp @@ -182,5 +182,5 @@ namespace MiscServices { { return mCustomizedValue; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/message.cpp b/services/src/message.cpp index 22935d5..a33ed29 100644 --- a/services/src/message.cpp +++ b/services/src/message.cpp @@ -72,5 +72,5 @@ namespace MiscServices { msgContent_ = nullptr; } } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/message_handler.cpp b/services/src/message_handler.cpp index d69fe04..d9e8e50 100644 --- a/services/src/message_handler.cpp +++ b/services/src/message_handler.cpp @@ -76,6 +76,5 @@ namespace MiscServices { } return handler; } -} -} - +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/peruser_session.cpp b/services/src/peruser_session.cpp index a0275db..1460126 100644 --- a/services/src/peruser_session.cpp +++ b/services/src/peruser_session.cpp @@ -257,8 +257,8 @@ namespace MiscServices { std::map, ClientInfo*>::const_iterator it; bool flag = false; for (it = mapClients.cbegin(); it != mapClients.cend(); ++it) { - if ((i == DEFAULT_IME && it->second->attribute.GetSecurityFlag() == false) || - (i == SECURITY_IME && it->second->attribute.GetSecurityFlag() == true)) { + if ((i == DEFAULT_IME && !it->second->attribute.GetSecurityFlag()) || + (i == SECURITY_IME && it->second->attribute.GetSecurityFlag())) { flag = true; break; } @@ -607,7 +607,7 @@ namespace MiscServices { break; } } - if (flag == false) { + if (!flag) { IMSA_HILOGW("Aborted! The client died is not found! [%{public}d]\n", userId_); return; } @@ -936,7 +936,7 @@ namespace MiscServices { { static int errorNum[2] = {0, 0}; static time_t past[2] = {time(0), time(0)}; - if (resetFlag == true) { + if (resetFlag) { errorNum[imeIndex] = 0; past[imeIndex] = 0; return 0; @@ -1026,7 +1026,7 @@ namespace MiscServices { } } } - if (flag == false) { + if (!flag) { IMSA_HILOGW("The current keyboard type is not found in the current IME. Reset it!"); type = GetKeyboardType(imeIndex, currentKbdIndex[imeIndex]); } else if (imsCore[imeIndex] == imsCore[1 - imeIndex]) { @@ -1071,7 +1071,7 @@ namespace MiscServices { return -1; } - if (clientInfo->attribute.GetSecurityFlag() == true) { + if (clientInfo->attribute.GetSecurityFlag()) { return SECURITY_IME; } return DEFAULT_IME; @@ -1264,7 +1264,7 @@ namespace MiscServices { imsCore[0] = core; sptr agentObject = data->ReadRemoteObject(); - sptr proxy=new InputMethodAgentProxy(agentObject); + sptr proxy = new InputMethodAgentProxy(agentObject); imsAgent = proxy; InitInputControlChannel(); @@ -1321,5 +1321,5 @@ namespace MiscServices { imsCore[0]->StopInputService(imeId); } } -} -} +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/peruser_setting.cpp b/services/src/peruser_setting.cpp index 38fb9ac..017f33d 100644 --- a/services/src/peruser_setting.cpp +++ b/services/src/peruser_setting.cpp @@ -141,7 +141,7 @@ namespace MiscServices { for (it = inputMethodProperties.begin(); it < inputMethodProperties.end(); ++it) { InputMethodProperty *node = (InputMethodProperty*)*it; if (node->mImeId == imeId) { - if (CheckIfSecurityIme(*node) == true) { + if (CheckIfSecurityIme(*node)) { securityFlag = true; } inputMethodProperties.erase(it); @@ -162,7 +162,7 @@ namespace MiscServices { imSetting.SetValue(key, inputMethodSetting.GetValue(key)); bool flag = imSetting.RemoveEnabledInputMethod(imeId); - if (flag == false) { + if (!flag) { IMSA_HILOGI("The package removed is not an enabled IME. [%d]\n", userId_); return ErrorCode::NO_ERROR; } @@ -219,7 +219,7 @@ namespace MiscServices { if (imeId == currentImeId) { flag = true; } else if (enabledInputMethods.find(imeId) != std::string::npos) { - if (flag == true) { + if (flag) { nextImeId = imeId; break; } else if (firstEnabledProperty == nullptr) { @@ -338,7 +338,7 @@ namespace MiscServices { std::u16string systemLocales = inputMethodSetting.GetValue(InputMethodSetting::SYSTEM_LOCALE_TAG); for (int i = 0; i < (int)inputMethodProperties.size(); i++) { InputMethodProperty *imp = inputMethodProperties[i]; - if (CheckIfSecurityIme(*imp) == false) { + if (!CheckIfSecurityIme(*imp)) { continue; } // if systemLocales is not setting, return the first security ime @@ -375,7 +375,7 @@ namespace MiscServices { if (imeId == currentImeId) { flag = true; } else if (enabledInputMethods.find(imeId) != std::string::npos) { - if (flag == true) { + if (flag) { return inputMethodProperties[i]; } else if (firstEnabledProperty == nullptr) { firstEnabledProperty = inputMethodProperties[i]; @@ -476,9 +476,9 @@ namespace MiscServices { void PerUserSetting::InitInputMethodSetting() { bool flag = inputMethodSetting.FindKey(InputMethodSetting::ENABLED_INPUT_METHODS_TAG); - if (flag == false) { + if (!flag) { for (int i = 0; i < (int)inputMethodProperties.size(); i++) { - if (CheckIfSecurityIme(*inputMethodProperties[i]) == true) { + if (CheckIfSecurityIme(*inputMethodProperties[i])) { continue; } std::vector types; @@ -492,13 +492,13 @@ namespace MiscServices { flag = inputMethodSetting.FindKey(InputMethodSetting::CURRENT_INPUT_METHOD_TAG); std::u16string imeId = inputMethodSetting.GetCurrentInputMethod(); - if (flag == false) { + if (!flag) { ResetCurrentInputMethod(); } else { currentImeId = imeId; } flag = inputMethodSetting.FindKey(InputMethodSetting::CURRENT_SYS_KEYBOARD_TYPE_TAG); - if (flag == false) { + if (!flag) { inputMethodSetting.SetCurrentSysKeyboardType(-1); } Platform::Instance()->SetInputMethodSetting(userId_, inputMethodSetting); @@ -543,7 +543,7 @@ namespace MiscServices { // if we cannot find any keyboard type which belongs to system locales, // we will use the first enabled ime as current ime. - if (flag == false) { + if (!flag) { if (firstEnabledIme) { currentImeId = firstEnabledIme->mImeId; } else { @@ -577,5 +577,5 @@ namespace MiscServices { { return property.isSystemIme; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/platform.cpp b/services/src/platform.cpp index 046a6a5..57c10cd 100644 --- a/services/src/platform.cpp +++ b/services/src/platform.cpp @@ -185,5 +185,5 @@ namespace MiscServices { (void)displayId; return true; } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/services/src/platform_callback_stub.cpp b/services/src/platform_callback_stub.cpp index 352b006..f34e8ff 100644 --- a/services/src/platform_callback_stub.cpp +++ b/services/src/platform_callback_stub.cpp @@ -104,5 +104,5 @@ namespace MiscServices { Message *msg = new Message(msgId, parcel); MessageHandler::Instance()->SendMessage(msg); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/unitest/src/input_method_ability_test.cpp b/unitest/src/input_method_ability_test.cpp index 2dc3860..a07f163 100644 --- a/unitest/src/input_method_ability_test.cpp +++ b/unitest/src/input_method_ability_test.cpp @@ -139,5 +139,5 @@ namespace MiscServices { EXPECT_TRUE(deserialization != nullptr); EXPECT_TRUE(deserialization->getId() == def_value); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS diff --git a/unitest/src/input_method_controller_test.cpp b/unitest/src/input_method_controller_test.cpp index ba8878a..d6e45b1 100644 --- a/unitest/src/input_method_controller_test.cpp +++ b/unitest/src/input_method_controller_test.cpp @@ -231,5 +231,5 @@ namespace MiscServices { sleep(waitForStatusOk); IMSA_HILOGI("IMC TEST OVER"); } -} -} \ No newline at end of file +} // namespace MiscServices +} // namespace OHOS