Merge "Build and package Layer Management service binaries." into tizen
[profile/ivi/layer-management.git] / LayerManagerBase / include / Configuration.h
1 /***************************************************************************
2  * Copyright 2012 BMW Car IT GmbH
3  * Copyright (C) 2012 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
4  *
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  ****************************************************************************/
19
20 #ifndef __CONFIGURATION_H__
21 #define __CONFIGURATION_H__
22
23 #include "config.h"
24 #include <string>
25
26 //============================================================================
27 // default configuration for LayerManagementService
28 //============================================================================
29 #define DEFAULT_DISPLAY_NAME        ":0"
30 #define DEFAULT_DISPLAY_WIDTH       1280
31 #define DEFAULT_DISPLAY_HEIGHT      480
32
33 #define DEFAULT_LOG_LEVEL_CONSOLE   2
34 #define DEFAULT_LOG_LEVEL_FILE      0
35 #define DEFAULT_LOG_LEVEL_TRACE     4
36
37 #define DEFAULT_PLUGIN_PATH         CMAKE_INSTALL_PREFIX"/lib/layermanager"
38
39 //============================================================================
40 // configuration class
41 //============================================================================
42 class Configuration
43 {
44 public:
45     Configuration(int argc, char** argv);
46
47     std::string getDisplayName();
48     int getDisplayWidth();
49     int getDisplayHeight();
50
51     int getLogLevelConsole();
52     int getLogLevelFile();
53     int getLogLevelTrace();
54
55     std::string getPluginPath();
56
57     void logAllSettings();
58
59 private:
60     void processCommandLine(int argc, char** argv);
61     void processBuildFlags();
62     void processEnvironmentVariables();
63
64 private:
65     // command line arguments
66     std::string mCommandLine;
67     int mDisplayWidth;
68     int mDisplayHeight;
69     int mLogLevelConsole;
70     int mLogLevelFile;
71     int mLogLevelTrace;
72
73     // environment
74     std::string mDisplayName;
75     std::string mPluginPath;
76
77     // build flags
78     const BuildFlag* mpBuildFlags;
79     const int mBuildFlagCount;
80 };
81
82 #endif // __CONFIGURATION_H__