1/*
2 * Copyright (c) 2022 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_ABILITY_RUNTIME_WINDOW_INFO_H
17#define OHOS_ABILITY_RUNTIME_WINDOW_INFO_H
18
19#include "parcel.h"
20#include "context.h"
21
22namespace OHOS {
23namespace AAFwk {
24enum class TransitionReason : uint32_t {
25    MINIMIZE = 0,
26    CLOSE,
27    ABILITY_TRANSITION,
28    BACK_TRANSITION,
29};
30struct AbilityTransitionInfo : public Parcelable {
31    std::string bundleName_;
32    std::string abilityName_;
33    uint32_t mode_ = 0;
34    std::vector<AppExecFwk::SupportWindowMode> windowModes_;
35    sptr<IRemoteObject> abilityToken_ = nullptr;
36    uint64_t displayId_ = 0;
37    bool isShowWhenLocked_ = false;
38    bool isRecent_ = false;
39    double maxWindowRatio_;
40    double minWindowRatio_;
41    uint32_t maxWindowWidth_;
42    uint32_t minWindowWidth_;
43    uint32_t maxWindowHeight_;
44    uint32_t minWindowHeight_;
45    TransitionReason reason_ = TransitionReason::ABILITY_TRANSITION;
46    int32_t missionId_ = -1;
47    AppExecFwk::DisplayOrientation orientation_ = AppExecFwk::DisplayOrientation::UNSPECIFIED;
48    uint32_t apiCompatibleVersion_ = 0;
49
50    virtual bool Marshalling(Parcel& parcel) const override
51    {
52        return true;
53    }
54
55    bool WriteWindowInfo(Parcel& parcel) const
56    {
57        return true;
58    }
59
60    static AbilityTransitionInfo* Unmarshalling(Parcel& parcel)
61    {
62        return nullptr;
63    }
64};
65} // namespace AAFwk
66} // namespace OHOS
67#endif // OHOS_ABILITY_RUNTIME_WINDOW_INFO_H
68