-
Notifications
You must be signed in to change notification settings - Fork 574
/
Copy pathWeaselClientImpl.h
49 lines (40 loc) · 1.2 KB
/
WeaselClientImpl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <WeaselIPC.h>
#include <PipeChannel.h>
namespace weasel {
class ClientImpl {
public:
ClientImpl();
~ClientImpl();
bool Connect(ServerLauncher const& launcher);
void Disconnect();
void ShutdownServer();
void StartSession();
void EndSession();
void StartMaintenance();
void EndMaintenance();
bool Echo();
bool ProcessKeyEvent(KeyEvent const& keyEvent);
bool CommitComposition();
bool ClearComposition();
bool SelectCandidateOnCurrentPage(size_t index);
bool HighlightCandidateOnCurrentPage(size_t index);
bool ChangePage(bool backward);
void UpdateInputPosition(RECT const& rc);
void FocusIn();
void FocusOut();
void TrayCommand(UINT menuId);
bool GetResponseData(ResponseHandler const& handler);
protected:
void _InitializeClientInfo();
bool _WriteClientInfo();
LRESULT _SendMessage(WEASEL_IPC_COMMAND Msg, DWORD wParam, DWORD lParam);
bool _Connected() const { return channel.Connected(); }
bool _Active() const { return channel.Connected() && session_id != 0; }
private:
UINT session_id;
std::wstring app_name;
bool is_ime;
PipeChannel<PipeMessage> channel;
};
} // namespace weasel