• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 OHOS_ROSEN_WINDOW_DRAWING_CONTENT_INFO_H
17 #define OHOS_ROSEN_WINDOW_DRAWING_CONTENT_INFO_H
18 
19 #include "wm_common.h"
20 
21 namespace OHOS::Rosen {
22 /**
23  * @enum WindowDrawingContentState
24  *
25  * @brief DrawingContent state of a window
26  */
27 enum WindowDrawingContentState {
28     WINDOW_DRAWING_CONTENT_CHANGE = 0,
29     WINDOW_DRAWING_CONTENT_NO_CHANGE,
30     WINDOW_DRAWING_CONTENT_UNKNOWN_TYPE,
31 };
32 
33 /**
34  * @class WindowDrawingContentInfo
35  *
36  * @brief DrawingContent info of window.
37  */
38 class WindowDrawingContentInfo : public Parcelable {
39 public:
40     /**
41      * @brief Default construct of WindowDrawingContentInfo.
42      */
43     WindowDrawingContentInfo() = default;
44 
45     /**
46      * @brief Construct of WindowDrawingContentInfo.
47      *
48      * @param winId Window id.
49      * @param pid Process id.
50      * @param uid User id.
51      * @param drawing content True means window is drawing, false means the opposite.
52      * @param winType Type of window.
53      */
WindowDrawingContentInfo(uint32_t winId,int32_t pid,int32_t uid,bool drawingContentState,WindowType winType)54     WindowDrawingContentInfo(uint32_t winId, int32_t pid, int32_t uid, bool drawingContentState,
55         WindowType winType) : windowId_(winId), pid_(pid), uid_(uid),
56         drawingContentState_(drawingContentState), windowType_(winType) {};
57 
58     /**
59      * @brief Deconstruct of WindowDrawingContentInfo.
60      */
61     ~WindowDrawingContentInfo() = default;
62 
63     /**
64      * @brief Marshalling WindowDrawingContentInfo.
65      *
66      * @param parcel Package of WindowDrawingContentInfo.
67      * @return True means marshall success, false means marshall failed.
68      */
69     virtual bool Marshalling(Parcel& parcel) const override;
70 
71     /**
72      * @brief Unmarshalling WindowDrawingContentInfo.
73      *
74      * @param parcel Package of WindowDrawingContentInfo.
75      * @return WindowDrawingContentInfo object.
76      */
77     static WindowDrawingContentInfo* Unmarshalling(Parcel& parcel);
78 
79     uint32_t windowId_ { INVALID_WINDOW_ID };
80     int32_t pid_ { 0 };
81     int32_t uid_ { 0 };
82     bool drawingContentState_ {false};
83     WindowType windowType_ { WindowType::WINDOW_TYPE_APP_MAIN_WINDOW };
84 };
85 } // namespace OHOS::Rosen
86 #endif // OHOS_ROSEN_WINDOW_VISIBILITY_INFO_H