summaryrefslogtreecommitdiff
path: root/lingucomponent/source/languageguessing
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-06-19 15:01:00 +0000
committerKurt Zenker <kz@openoffice.org>2007-06-19 15:01:00 +0000
commitc60763a8b4d48ea57d75688d00d635f9ac88a142 (patch)
tree1d0c76af46b3404477e5ef3d6854f63badedd3cd /lingucomponent/source/languageguessing
parent0762811922c4e1a3474bdd91daf308baafbc18e4 (diff)
INTEGRATION: CWS languageguessing (1.1.2); FILE ADDED
2007/01/12 11:05:29 tl 1.1.2.1: #i73173# integrate Google SoC language-guessing
Diffstat (limited to 'lingucomponent/source/languageguessing')
-rw-r--r--lingucomponent/source/languageguessing/guess.hxx89
1 files changed, 89 insertions, 0 deletions
diff --git a/lingucomponent/source/languageguessing/guess.hxx b/lingucomponent/source/languageguessing/guess.hxx
new file mode 100644
index 000000000000..6fd0903012d3
--- /dev/null
+++ b/lingucomponent/source/languageguessing/guess.hxx
@@ -0,0 +1,89 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Merand Jocelyn *
+ * joc.mer@gmail.com *
+ * *
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: guess.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: kz $ $Date: 2007-06-19 16:01:00 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef GUESS_H
+#define GUESS_H
+
+#define GUESS_SEPARATOR_OPEN '['
+#define GUESS_SEPARATOR_CLOSE ']'
+#define GUESS_SEPARATOR_SEP '-'
+#define DEFAULT_LANGUAGE ""
+#define DEFAULT_COUNTRY ""
+#define DEFAULT_ENCODING ""
+
+#include <string>
+
+using namespace std;
+
+/**
+@author Jocelyn Merand
+ */
+class Guess{
+ public:
+
+ /**
+ * Default init
+ */
+ Guess();
+
+ /**
+ * Init from 3 strings (language, country and encoding) and 1 int witch represents the rank
+ */
+ Guess(string& lang, string& country, string& enc, int order);
+
+ /**
+ * Init from a string like [en-UK-utf8] and the rank
+ */
+ Guess(char * guess_str, int order);
+
+ ~Guess();
+
+ string GetLanguage();
+ string GetCountry();
+ string GetEncoding();
+ int GetOrder();
+
+ bool operator==(string lang);
+
+ protected:
+ string language_str;
+ string country_str;
+ string encoding_str;
+ int order;
+};
+
+#endif