librime: formatter.h Source File

| librime 1.2 Rime Input Method Engine, the core library

formatter.h
Go to the documentation of this file.
1//
2// Copyright RIME Developers
3// Distributed under the BSD License
4//
5// 2013-07-02 GONG Chen <chen.sst@gmail.com>
6//
7
8#ifndef RIME_FORMATTER_H_
9#define RIME_FORMATTER_H_
10
11#include <rime/common.h>
12#include <rime/component.h>
13#include <rime/ticket.h>
14
15namespace rime {
16
17class Engine;
18
19 class Formatter : public Class<Formatter, const Ticket&> {
20 public:
21 Formatter(const Ticket& ticket)
22 : engine_(ticket.engine), name_space_(ticket.name_space) {}
23 virtual ~Formatter() = default;
24
25 virtual void Format(string* text) = 0;
26
27 protected:
28 Engine* engine_;
29 string name_space_;
30};
31
32} // namespace rime
33
34#endif // RIME_FORMATTER_H_
common.h
component.h
ticket.h
rime
Definition algebra.cc:12
rime::Class
Definition component.h:21
rime::Engine
Definition engine.h:20
rime::Formatter::~Formatter
virtual ~Formatter()=default
rime::Formatter::Format
virtual void Format(string *text)=0
rime::Formatter::Formatter
Formatter(const Ticket &ticket)
Definition formatter.h:21
rime::Formatter::name_space_
string name_space_
Definition formatter.h:29
rime::Formatter::engine_
Engine * engine_
Definition formatter.h:28
rime::Ticket
Definition ticket.h:17