1 /*
2  * Copyright (c) 2020 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 #ifndef OHOS_ACELITE_APP_STYLE_LIST_H
16 #define OHOS_ACELITE_APP_STYLE_LIST_H
17 
18 #include "non_copyable.h"
19 #include "stylemgr/app_style.h"
20 #include "stylemgr/app_style_item.h"
21 
22 namespace OHOS {
23 namespace ACELite {
24 class AppStyleList final : public MemoryHeap {
25 public:
26     ACE_DISALLOW_COPY_AND_MOVE(AppStyleList);
AppStyleList()27     AppStyleList() : firstStyle_(nullptr), lastStyle_(nullptr) {}
28 
~AppStyleList()29     ~AppStyleList()
30     {
31         Reset();
32     }
33 
GetFirst()34     const AppStyle* GetFirst() const
35     {
36         return firstStyle_;
37     }
38 
39     void Reset();
40     void AddStyle(AppStyle* newStyle);
41     bool IsStyleExist(const AppStyle &newStyle);
42     AppStyle *GetExistStyle(const char *name) const;
43 
44 private:
45     AppStyle* firstStyle_;
46     AppStyle* lastStyle_;
47 };
48 } // namespace ACELite
49 } // namespace OHOS
50 #endif // OHOS_ACELITE_STYLE_LIST_H
51