• 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_VISIBILITY_INFO_H
17 #define OHOS_ROSEN_WINDOW_VISIBILITY_INFO_H
18 
19 #include "wm_common.h"
20 
21 namespace OHOS::Rosen {
22 /**
23  * @class WindowVisibilityInfo
24  *
25  * @brief Visibility info of window.
26  */
27 class WindowVisibilityInfo : public Parcelable {
28 public:
29     /**
30      * @brief Default construct of WindowVisibilityInfo.
31      */
32     WindowVisibilityInfo() = default;
33     /**
34      * @brief Construct of WindowVisibilityInfo.
35      *
36      * @param winId Window id.
37      * @param pid Process id.
38      * @param uid User id.
39      * @param visibility True means window is visible, false means the opposite.
40      * @param winType Type of window.
41      */
WindowVisibilityInfo(uint32_t winId,int32_t pid,int32_t uid,bool visibility,WindowType winType)42     WindowVisibilityInfo(uint32_t winId, int32_t pid, int32_t uid, bool visibility, WindowType winType)
43         : windowId_(winId), pid_(pid), uid_(uid), isVisible_(visibility), windowType_(winType) {};
44     /**
45      * @brief Deconstruct of WindowVisibilityInfo.
46      */
47     ~WindowVisibilityInfo() = default;
48 
49     /**
50      * @brief Marshalling WindowVisibilityInfo.
51      *
52      * @param parcel Package of WindowVisibilityInfo.
53      * @return True means marshall success, false means marshall failed.
54      */
55     virtual bool Marshalling(Parcel& parcel) const override;
56     /**
57      * @brief Unmarshalling WindowVisibilityInfo.
58      *
59      * @param parcel Package of WindowVisibilityInfo.
60      * @return WindowVisibilityInfo object.
61      */
62     static WindowVisibilityInfo* Unmarshalling(Parcel& parcel);
63 
64     uint32_t windowId_ { INVALID_WINDOW_ID };
65     int32_t pid_ { 0 };
66     int32_t uid_ { 0 };
67     bool isVisible_ { false };
68     WindowType windowType_ { WindowType::WINDOW_TYPE_APP_MAIN_WINDOW };
69 };
70 } // namespace OHOS::Rosen
71 #endif // OHOS_ROSEN_WINDOW_VISIBILITY_INFO_H