1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * Copyright (C) 2005 Takuro Ashie 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2, or (at your option) 8 * any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 */ 19 20 #ifndef __SCIM_ANTHY_UTILS_H__ 21 #define __SCIM_ANTHY_UTILS_H__ 22 23 #define Uses_SCIM_ICONV 24 #define Uses_SCIM_EVENT 25 #define Uses_SCIM_ATTRIBUTE 26 #include <scim.h> 27 28 using namespace scim; 29 30 namespace scim_anthy { 31 32 bool util_match_key_event (const KeyEventList &list, 33 const KeyEvent &key, 34 uint16 ignore_mask = 0); 35 void util_split_string (String &str, 36 std::vector<String> &str_list, 37 char *delim, 38 int num); 39 void util_convert_to_wide (WideString &wide, 40 const String &str); 41 void util_convert_to_half (String &half, 42 const WideString &str); 43 void util_convert_to_katakana (WideString &kata, 44 const WideString &hira, 45 bool half = false); 46 void util_create_attributes (AttributeList &attrs, 47 unsigned int start, 48 unsigned int length, 49 String type, 50 unsigned int fg_color, 51 unsigned int bg_color); 52 bool util_key_is_keypad (const KeyEvent &key); 53 void util_keypad_to_string (String &str, 54 const KeyEvent &key); 55 void util_launch_program (const char *command); 56 57 } 58 59 #endif /* __SCIM_ANTHY_UTILS_H__ */ 60