clean db
[platform/upstream/ibus-libpinyin.git] / src / PYDynamicSpecialPhrase.h
1 /* vim:set et ts=4 sts=4:
2  *
3  * ibus-pinyin - The Chinese PinYin engine for IBus
4  *
5  * Copyright (c) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 #ifndef __PY_DYNAMIC_SPECIAL_PHRASE_H_
22 #define __PY_DYNAMIC_SPECIAL_PHRASE_H_
23
24 #include <ctime>
25 #include <string>
26 #include <glib.h>
27 #include "PYSpecialPhrase.h"
28
29 namespace PY {
30
31 class DynamicSpecialPhrase : public SpecialPhrase {
32 public:
33     DynamicSpecialPhrase (const std::string &text, guint pos) :
34         SpecialPhrase (pos), m_text (text) { }
35     ~DynamicSpecialPhrase (void);
36
37     std::string text (void);
38     const std::string dec (gint d, const gchar *fmt = "%d");
39     const std::string year_cn (gboolean yy = FALSE);
40     const std::string month_cn (void);
41     const std::string weekday_cn (void);
42     const std::string hour_cn (guint i);
43     const std::string fullhour_cn (void);
44     const std::string halfhour_cn (void);
45     const std::string day_cn (void);
46     const std::string minsec_cn (guint i);
47     const std::string variable (const std::string &name);
48
49     /* declaration function about Chinese Number. */
50     const std::string simplest_cn_number(gint64 num);
51     const std::string simplified_number(gint64 num);
52     const std::string traditional_number(gint64 num);
53
54 private:
55     std::string m_text;
56     std::tm m_time;
57 };
58
59 };
60 #endif