1 /*********************************************************************
2  *
3  * KasumiConfiguration.hxx
4  *
5  * Kasumi - a management tool for a private dictionary of anthy
6  *
7  * Copyright (C) 2004-2006 Takashi Nakamoto
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22  * MA  02110-1301, USA.
23  *
24 *********************************************************************/
25 
26 #ifndef __KASUMI_CONFIGURATION_HXX__
27 #define __KASUMI_CONFIGURATION_HXX__
28 
29 #ifdef HAVE_CONFIG_H
30 #include "config.h"
31 #endif
32 
33 #include <map>
34 #include "KasumiException.hxx"
35 
36 class KasumiConfiguration{
37 private:
38   map<string, string> config;
39   string ConfFileName;
40 
41   void loadDefaultProperties() throw(KasumiException);
42   void loadConfigurationFile() throw (KasumiException);
43   void loadConfigurationFromArgument(int argc, char *argv[])
44     throw(KasumiException);
45   void saveConfiguration() throw (KasumiException);
46 
47   void setPropertyValue(const string &name, const string &value);
48   void checkValidity() throw(KasumiException);
49 public:
50   KasumiConfiguration(int argc, char *argv[]) throw (KasumiException);
51   ~KasumiConfiguration();
52   string getPropertyValue(const string &name);
53   int getPropertyValueByInt(const string &name);
54   bool getPropertyValueByBool(const string &name);
55 };
56 
57 bool isValidShortcutKey(const string &key);
58 
59 #endif
60