forked from rime/weasel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Layout.h
34 lines (29 loc) · 1.04 KB
/
Layout.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
#pragma once
#include <WeaselCommon.h>
#include <WeaselUI.h>
namespace weasel
{
class Layout
{
public:
Layout(const UIStyle &style, const Context &context, const Status &status);
virtual void DoLayout(CDCHandle dc) = 0;
/* All points in this class is based on the content area */
/* The top-left corner of the content area is always (0, 0) */
virtual CSize GetContentSize() const = 0;
virtual CRect GetPreeditRect() const = 0;
virtual CRect GetAuxiliaryRect() const = 0;
virtual CRect GetHighlightRect() const = 0;
virtual CRect GetCandidateLabelRect(int id) const = 0;
virtual CRect GetCandidateTextRect(int id) const = 0;
virtual CRect GetCandidateCommentRect(int id) const = 0;
virtual CRect GetStatusIconRect() const = 0;
virtual std::wstring GetLabelText(const std::vector<Text> &labels, int id, const wchar_t *format) const = 0;
virtual bool IsInlinePreedit() const = 0;
virtual bool ShouldDisplayStatusIcon() const = 0;
protected:
const UIStyle &_style;
const Context &_context;
const Status &_status;
};
};