mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-19 12:08:05 -04:00
@@ -27,21 +27,21 @@
|
||||
*/
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
class IInputClient : public IRemoteBroker {
|
||||
public:
|
||||
enum {
|
||||
ON_INPUT_READY = 0,
|
||||
ON_INPUT_RELEASED ,
|
||||
SET_DISPLAY_MODE ,
|
||||
};
|
||||
class IInputClient : public IRemoteBroker {
|
||||
public:
|
||||
enum {
|
||||
ON_INPUT_READY = 0,
|
||||
ON_INPUT_RELEASED,
|
||||
SET_DISPLAY_MODE,
|
||||
};
|
||||
|
||||
DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.InputClient");
|
||||
DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.InputClient");
|
||||
|
||||
virtual int32_t onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent, const InputChannel* channel) = 0;
|
||||
virtual int32_t onInputReleased(int32_t retValue) = 0;
|
||||
virtual int32_t setDisplayMode(int32_t mode) = 0;
|
||||
};
|
||||
virtual int32_t onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent,
|
||||
const InputChannel *channel) = 0;
|
||||
virtual int32_t onInputReleased(int32_t retValue) = 0;
|
||||
virtual int32_t setDisplayMode(int32_t mode) = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // FM_IMMS_PROJECT_IINPUTCLIENT_H
|
||||
#endif // FM_IMMS_PROJECT_IINPUTCLIENT_H
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
class IInputDataChannel: public IRemoteBroker {
|
||||
class IInputDataChannel : public IRemoteBroker {
|
||||
public:
|
||||
enum {
|
||||
INSERT_TEXT = 0,
|
||||
|
||||
@@ -22,15 +22,13 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
|
||||
class InputClientProxy : public IRemoteProxy<IInputClient>
|
||||
{
|
||||
class InputClientProxy : public IRemoteProxy<IInputClient> {
|
||||
public:
|
||||
explicit InputClientProxy(const sptr<IRemoteObject> &object);
|
||||
~InputClientProxy() = default;
|
||||
DISALLOW_COPY_AND_MOVE(InputClientProxy);
|
||||
|
||||
int32_t onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent, const InputChannel* channel) override;
|
||||
int32_t onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent, const InputChannel *channel) override;
|
||||
int32_t onInputReleased(int32_t retValue) override;
|
||||
int32_t setDisplayMode(int32_t mode) override;
|
||||
|
||||
|
||||
@@ -29,13 +29,13 @@ public:
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
InputClientStub();
|
||||
~InputClientStub();
|
||||
void SetHandler(MessageHandler* handler);
|
||||
void SetHandler(MessageHandler *handler);
|
||||
|
||||
int32_t onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent, const InputChannel* channel) override;
|
||||
int32_t onInputReady(int32_t retValue, const sptr<IInputMethodAgent>& agent, const InputChannel *channel) override;
|
||||
int32_t onInputReleased(int32_t retValue) override;
|
||||
int32_t setDisplayMode(int32_t mode) override;
|
||||
private:
|
||||
MessageHandler* msgHandler = nullptr;
|
||||
MessageHandler *msgHandler = nullptr;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef FM_IMC_PROJECT_INPUTDATACHANNELPROXY_H
|
||||
#define FM_IMC_PROJECT_INPUTDATACHANNELPROXY_H
|
||||
|
||||
@@ -23,21 +21,19 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
class InputDataChannelProxy : public IRemoteProxy<IInputDataChannel> {
|
||||
public:
|
||||
explicit InputDataChannelProxy(const sptr<IRemoteObject> &object);
|
||||
~InputDataChannelProxy() = default;
|
||||
DISALLOW_COPY_AND_MOVE(InputDataChannelProxy);
|
||||
|
||||
class InputDataChannelProxy : public IRemoteProxy<IInputDataChannel>
|
||||
{
|
||||
public:
|
||||
explicit InputDataChannelProxy(const sptr<IRemoteObject> &object);
|
||||
~InputDataChannelProxy() = default;
|
||||
DISALLOW_COPY_AND_MOVE(InputDataChannelProxy);
|
||||
bool InsertText(const std::u16string& text) override;
|
||||
bool DeleteBackward(int32_t length) override;
|
||||
void Close() override;
|
||||
|
||||
bool InsertText(const std::u16string& text) override;
|
||||
bool DeleteBackward(int32_t length) override;
|
||||
void Close() override;
|
||||
|
||||
private:
|
||||
static inline BrokerDelegator<InputDataChannelProxy> delegator_;
|
||||
};
|
||||
private:
|
||||
static inline BrokerDelegator<InputDataChannelProxy> delegator_;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -29,13 +29,13 @@ public:
|
||||
int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
|
||||
InputDataChannelStub();
|
||||
~InputDataChannelStub();
|
||||
void SetHandler(MessageHandler* handler);
|
||||
void SetHandler(MessageHandler *handler);
|
||||
|
||||
bool InsertText(const std::u16string& text) override;
|
||||
bool DeleteBackward(int32_t length) override;
|
||||
void Close() override;
|
||||
private:
|
||||
MessageHandler* msgHandler;
|
||||
MessageHandler *msgHandler;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#ifndef FM_IMC_PROJECT_INPUTMETHODCONTROLLER_H
|
||||
#define FM_IMC_PROJECT_INPUTMETHODCONTROLLER_H
|
||||
|
||||
//#include "refbase.h"
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include "input_data_channel_stub.h"
|
||||
@@ -30,7 +29,6 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
|
||||
class OnTextChangedListener : public virtual RefBase {
|
||||
public:
|
||||
virtual void InsertText(const std::u16string& text) = 0;
|
||||
@@ -60,7 +58,8 @@ namespace MiscServices {
|
||||
|
||||
bool Initialize();
|
||||
sptr<InputMethodSystemAbilityProxy> GetImsaProxy();
|
||||
void PrepareInput(int32_t displayId,sptr<InputClientStub> &client,sptr<InputDataChannelStub> &channel,InputAttribute &attribute);
|
||||
void PrepareInput(int32_t displayId, sptr<InputClientStub> &client, sptr<InputDataChannelStub> &channel,
|
||||
InputAttribute &attribute);
|
||||
void StartInput(sptr<InputClientStub> &client);
|
||||
void StopInput(sptr<InputClientStub> &client);
|
||||
void ReleaseInput(sptr<InputClientStub> &client);
|
||||
@@ -71,13 +70,13 @@ namespace MiscServices {
|
||||
sptr<InputMethodSystemAbilityProxy> mImms;
|
||||
sptr<ImsaDeathRecipient> deathRecipient_;
|
||||
sptr<InputMethodAgentProxy> mAgent;
|
||||
OnTextChangedListener* textListener;
|
||||
OnTextChangedListener *textListener;
|
||||
InputAttribute mAttribute;
|
||||
|
||||
static std::mutex instanceLock_;
|
||||
static sptr<InputMethodController> instance_;
|
||||
std::thread workThreadHandler;
|
||||
MessageHandler* msgHandler;
|
||||
MessageHandler *msgHandler;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FM_IMC_PROJECT_INPUTMETHODSYSTEMABILITYPROXY_H
|
||||
#define FM_IMC_PROJECT_INPUTMETHODSYSTEMABILITYPROXY_H
|
||||
|
||||
@@ -30,35 +29,34 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
class InputMethodSystemAbilityProxy : public IRemoteProxy<IInputMethodSystemAbility> {
|
||||
public:
|
||||
explicit InputMethodSystemAbilityProxy(const sptr<IRemoteObject> &object);
|
||||
~InputMethodSystemAbilityProxy() = default;
|
||||
DISALLOW_COPY_AND_MOVE(InputMethodSystemAbilityProxy);
|
||||
|
||||
class InputMethodSystemAbilityProxy : public IRemoteProxy<IInputMethodSystemAbility>
|
||||
{
|
||||
public:
|
||||
explicit InputMethodSystemAbilityProxy(const sptr<IRemoteObject> &object);
|
||||
~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 int32_t setInputMethodCore(sptr<IInputMethodCore> &core) 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 int32_t setInputMethodCore(sptr<IInputMethodCore> &core) override;
|
||||
int32_t Prepare(int32_t displayId, sptr<InputClientStub> &client, sptr<InputDataChannelStub> &channel,
|
||||
InputAttribute &attribute);
|
||||
int32_t Release(sptr<InputClientStub> &client);
|
||||
int32_t Start(sptr<InputClientStub> &client);
|
||||
int32_t Stop(sptr<InputClientStub> &client);
|
||||
|
||||
int32_t Prepare(int32_t displayId, sptr<InputClientStub> &client, sptr<InputDataChannelStub> &channel, InputAttribute &attribute);
|
||||
int32_t Release(sptr<InputClientStub> &client);
|
||||
int32_t Start(sptr<InputClientStub> &client);
|
||||
int32_t Stop(sptr<InputClientStub> &client);
|
||||
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<InputMethodProperty*> *properties) override;
|
||||
virtual int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) override;
|
||||
virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) 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<InputMethodProperty*> *properties) override;
|
||||
virtual int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) override;
|
||||
virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) override;
|
||||
|
||||
private:
|
||||
static inline BrokerDelegator<InputMethodSystemAbilityProxy> delegator_;
|
||||
};
|
||||
private:
|
||||
static inline BrokerDelegator<InputMethodSystemAbilityProxy> delegator_;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user