• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 POWERMGR_SCREEN_SAVER_FEATURE_H
17 #define POWERMGR_SCREEN_SAVER_FEATURE_H
18 
19 #include <feature.h>
20 
21 #include "screen_saver_interface.h"
22 #include "screen_saver_mgr.h"
23 
24 typedef struct {
25     INHERIT_FEATURE;
26     INHERIT_IUNKNOWNENTRY(ScreenSaverInterface);
27     Identity identity;
28 } ScreenSaverFeature;
29 
30 const char *GetScreenSaverFeatureName(Feature *feature);
31 void OnScreenSaverFeatureInitialize(Feature *feature, Service *parent, Identity identity);
32 void OnScreenSaverFeatureStop(Feature *feature, Identity identity);
33 BOOL OnScreenSaverFeatureMessage(Feature *feature, Request *request);
34 int32_t OnSetScreenSaverState(IUnknown *iUnknown, BOOL enable);
35 
36 #define SCREEN_SAVER_FEATURE_INTERFACE_IMPL                         \
37     .GetName = GetScreenSaverFeatureName,                                      \
38     .OnInitialize = OnScreenSaverFeatureInitialize,                            \
39     .OnStop = OnScreenSaverFeatureStop,                                        \
40     .OnMessage = OnScreenSaverFeatureMessage
41 
42 #define SCREEN_SAVER_INTERFACE_IMPL                                 \
43     .SetScreenSaverStateFunc = OnSetScreenSaverState
44 
45 ScreenSaverFeature *GetScreenSaverFeatureImpl(void);
46 
47 #endif // POWERMGR_SCREEN_SAVER_FEATURE_H
48