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 OHOS_ABILITY_RUNTIME_PROFILE_H 17 #define OHOS_ABILITY_RUNTIME_PROFILE_H 18 19 #include <string> 20 21 #include "nocopyable.h" 22 #include "parcel.h" 23 24 namespace OHOS { 25 namespace AppExecFwk { 26 class Profile : public Parcelable { 27 public: 28 Profile() = default; 29 explicit Profile(const std::string &name); 30 virtual ~Profile() = default; 31 32 /** 33 * @brief Obtains the profile name. 34 * 35 * @return Returns profile name. 36 */ GetName()37 inline const std::string &GetName() const 38 { 39 return profileName_; 40 } 41 42 /** 43 * @brief read this Sequenceable object from a Parcel. 44 * 45 * @param inParcel Indicates the Parcel object into which the Sequenceable object has been marshaled. 46 * @return Returns true if read successed; returns false otherwise. 47 */ 48 bool ReadFromParcel(Parcel &parcel); 49 50 /** 51 * @brief Marshals this Sequenceable object into a Parcel. 52 * 53 * @param outParcel Indicates the Parcel object to which the Sequenceable object will be marshaled. 54 */ 55 virtual bool Marshalling(Parcel &parcel) const override; 56 57 /** 58 * @brief Unmarshals this Sequenceable object from a Parcel. 59 * 60 * @param inParcel Indicates the Parcel object into which the Sequenceable object has been marshaled. 61 */ 62 static Profile *Unmarshalling(Parcel &parcel); 63 64 private: 65 std::string profileName_; // the name of the ability 66 }; 67 } // namespace AppExecFwk 68 } // namespace OHOS 69 #endif // OHOS_ABILITY_RUNTIME_PROFILE_H 70