1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_ABILITY_RUNTIME_SIMULATOR_COMMON_CONTEXT_H
17 #define FOUNDATION_ABILITY_RUNTIME_SIMULATOR_COMMON_CONTEXT_H
18 
19 #include <memory>
20 #include <mutex>
21 
22 #include "application_info.h"
23 #include "configuration.h"
24 #include "hap_module_info.h"
25 #include "options.h"
26 
27 namespace OHOS {
28 namespace AbilityRuntime {
29 class Context {
30 public:
31     Context() = default;
32     ~Context() = default;
33 
34     virtual std::string GetBundleName() = 0;
35 
36     virtual std::string GetBundleCodePath() = 0;
37 
38     virtual std::string GetBundleCodeDir() = 0;
39 
40     virtual std::string GetCacheDir() = 0;
41 
42     virtual std::string GetTempDir() = 0;
43 
44     virtual std::string GetResourceDir() = 0;
45 
46     virtual std::string GetFilesDir() = 0;
47 
48     virtual std::string GetDatabaseDir() = 0;
49 
50     virtual std::string GetPreferencesDir() = 0;
51 
52     virtual std::string GetDistributedFilesDir() = 0;
53 
54     virtual std::string GetCloudFileDir() = 0;
55 
56     virtual void SwitchArea(int mode) = 0;
57 
58     virtual int GetArea() = 0;
59 
60     virtual std::string GetBaseDir() = 0;
61 
62     virtual std::shared_ptr<AppExecFwk::Configuration> GetConfiguration() = 0;
63 
64     virtual Options GetOptions() = 0;
65 
66     virtual void SetOptions(const Options &options) = 0;
67 
68     virtual std::shared_ptr<AppExecFwk::ApplicationInfo> GetApplicationInfo() const = 0;
69 
70     virtual std::shared_ptr<AppExecFwk::HapModuleInfo> GetHapModuleInfo() const = 0;
71 };
72 } // namespace AbilityRuntime
73 } // namespace OHOS
74 #endif // FOUNDATION_ABILITY_RUNTIME_SIMULATOR_COMMON_CONTEXT_H
75