mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-24 01:15:27 -04:00
@@ -24,22 +24,19 @@
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/*! \class PlatformApiProxy
|
||||
\brief The proxy implementation of IPlatformApi
|
||||
|
||||
\todo This class will be deleted on target platform
|
||||
*/
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
class PlatformApi : public IRemoteProxy < IPlatformApi > {
|
||||
class PlatformApiProxy : public IRemoteProxy < IPlatformApi > {
|
||||
public:
|
||||
PlatformApi(const sptr < IRemoteObject >& impl)
|
||||
PlatformApiProxy(const sptr<IRemoteObject>& impl)
|
||||
: IRemoteProxy < IPlatformApi >(impl)
|
||||
{
|
||||
}
|
||||
|
||||
~PlatformApi()
|
||||
~PlatformApiProxy()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -60,11 +57,13 @@ namespace MiscServices {
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
|
||||
std::u16string getInterfaceDescriptor() {
|
||||
std::u16string getInterfaceDescriptor()
|
||||
{
|
||||
return Utils::to_utf16("20210814");
|
||||
}
|
||||
|
||||
sptr < IInputMethodCore > bindInputMethodService(const std::u16string& packageName, const std::u16string& intention, int userId)
|
||||
sptr < IInputMethodCore > bindInputMethodService(const std::u16string& packageName,
|
||||
const std::u16string& intention, int userId)
|
||||
{
|
||||
MessageParcel data, reply;
|
||||
MessageOption option;
|
||||
@@ -138,12 +137,14 @@ namespace MiscServices {
|
||||
return status;
|
||||
}
|
||||
int code = reply.ReadException();
|
||||
if (code != 0) // code=0, means no exception.
|
||||
if (code != 0) {
|
||||
// code=0, means no exception.
|
||||
return code;
|
||||
}
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
|
||||
int32_t listInputMethod(int userId, std::vector < InputMethodProperty* > * inputMethodProperties)
|
||||
int32_t listInputMethod(int userId, std::vector<InputMethodProperty*> *inputMethodProperties)
|
||||
{
|
||||
MessageParcel data, reply;
|
||||
MessageOption option;
|
||||
@@ -154,11 +155,13 @@ namespace MiscServices {
|
||||
return status;
|
||||
}
|
||||
int code = reply.ReadException();
|
||||
if (code != 0) // code=0, means no exception.
|
||||
if (code != 0) {
|
||||
// code=0, means no exception.
|
||||
return code;
|
||||
}
|
||||
int size = reply.ReadInt32();
|
||||
for (int i = 0; i < size; i++) {
|
||||
InputMethodProperty * property = new InputMethodProperty();
|
||||
InputMethodProperty *property = new InputMethodProperty();
|
||||
property = reply.ReadParcelable<InputMethodProperty>();
|
||||
inputMethodProperties->push_back(property);
|
||||
}
|
||||
@@ -166,7 +169,8 @@ namespace MiscServices {
|
||||
}
|
||||
|
||||
|
||||
virtual int32_t getInputMethodProperty(int userId, const std::u16string& packageName, InputMethodProperty * inputMethodProperty)
|
||||
virtual int32_t getInputMethodProperty(int userId, const std::u16string& packageName,
|
||||
InputMethodProperty *inputMethodProperty)
|
||||
{
|
||||
MessageParcel data, reply;
|
||||
MessageOption option;
|
||||
@@ -178,13 +182,15 @@ namespace MiscServices {
|
||||
return status;
|
||||
}
|
||||
int code = reply.ReadException();
|
||||
if (code != 0) // code=0, means no exception.
|
||||
if (code != 0) {
|
||||
// code=0, means no exception.
|
||||
return code;
|
||||
}
|
||||
inputMethodProperty = reply.ReadParcelable<InputMethodProperty>();
|
||||
return status;
|
||||
}
|
||||
|
||||
int32_t getInputMethodSetting(int userId, InputMethodSetting * inputMethodSetting)
|
||||
int32_t getInputMethodSetting(int userId, InputMethodSetting *inputMethodSetting)
|
||||
{
|
||||
MessageParcel data, reply;
|
||||
MessageOption option;
|
||||
@@ -195,8 +201,10 @@ namespace MiscServices {
|
||||
return status;
|
||||
}
|
||||
int code = reply.ReadException();
|
||||
if (code != 0) // code=0, means no exception.
|
||||
if (code != 0) {
|
||||
// code=0, means no exception.
|
||||
return code;
|
||||
}
|
||||
inputMethodSetting = reply.ReadParcelable<InputMethodSetting>();
|
||||
return status;
|
||||
}
|
||||
@@ -213,8 +221,10 @@ namespace MiscServices {
|
||||
return status;
|
||||
}
|
||||
int code = reply.ReadException();
|
||||
if (code != 0) // code=0, means no exception.
|
||||
if (code != 0) {
|
||||
// code=0, means no exception.
|
||||
return code;
|
||||
}
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user