196279301Sopenharmony_ci/*
296279301Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd.
396279301Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
496279301Sopenharmony_ci * you may not use this file except in compliance with the License.
596279301Sopenharmony_ci * You may obtain a copy of the License at
696279301Sopenharmony_ci *
796279301Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
896279301Sopenharmony_ci *
996279301Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1096279301Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1196279301Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1296279301Sopenharmony_ci * See the License for the specific language governing permissions and
1396279301Sopenharmony_ci * limitations under the License.
1496279301Sopenharmony_ci */
1596279301Sopenharmony_ci
1696279301Sopenharmony_ci#ifndef BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_TEMPLATE_H
1796279301Sopenharmony_ci#define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_TEMPLATE_H
1896279301Sopenharmony_ci
1996279301Sopenharmony_ci#include <memory>
2096279301Sopenharmony_ci#include <string>
2196279301Sopenharmony_ci#include "parcel.h"
2296279301Sopenharmony_ci#include "want_params.h"
2396279301Sopenharmony_ci
2496279301Sopenharmony_cinamespace OHOS {
2596279301Sopenharmony_cinamespace Notification {
2696279301Sopenharmony_ciclass NotificationTemplate : public Parcelable {
2796279301Sopenharmony_cipublic:
2896279301Sopenharmony_ci    /**
2996279301Sopenharmony_ci     * Default constructor used to create an empty NotificationTemplate instance.
3096279301Sopenharmony_ci     */
3196279301Sopenharmony_ci    NotificationTemplate() = default;
3296279301Sopenharmony_ci
3396279301Sopenharmony_ci    /**
3496279301Sopenharmony_ci     * Default deconstructor used to deconstruct.
3596279301Sopenharmony_ci     */
3696279301Sopenharmony_ci    ~NotificationTemplate() = default;
3796279301Sopenharmony_ci
3896279301Sopenharmony_ci    /**
3996279301Sopenharmony_ci     * Sets the template name to be included in a template notification.
4096279301Sopenharmony_ci     * @param name template name.
4196279301Sopenharmony_ci     */
4296279301Sopenharmony_ci    void SetTemplateName(const std::string &name);
4396279301Sopenharmony_ci
4496279301Sopenharmony_ci    /**
4596279301Sopenharmony_ci     * Obtains the template name to be included in a template notification.
4696279301Sopenharmony_ci     * @return template name.
4796279301Sopenharmony_ci     */
4896279301Sopenharmony_ci    std::string GetTemplateName() const;
4996279301Sopenharmony_ci
5096279301Sopenharmony_ci    /**
5196279301Sopenharmony_ci     * Sets the template data to be included in a template notification.
5296279301Sopenharmony_ci     * @param data template data.
5396279301Sopenharmony_ci     */
5496279301Sopenharmony_ci    void SetTemplateData(const std::shared_ptr<AAFwk::WantParams> &data);
5596279301Sopenharmony_ci
5696279301Sopenharmony_ci    /**
5796279301Sopenharmony_ci     * Obtains the template data to be included in a template notification.
5896279301Sopenharmony_ci     * @return template data.
5996279301Sopenharmony_ci     */
6096279301Sopenharmony_ci    std::shared_ptr<AAFwk::WantParams> GetTemplateData() const;
6196279301Sopenharmony_ci
6296279301Sopenharmony_ci    /**
6396279301Sopenharmony_ci     * Returns a string representation of the object.
6496279301Sopenharmony_ci     * @return a string representation of the object.
6596279301Sopenharmony_ci     */
6696279301Sopenharmony_ci    std::string Dump();
6796279301Sopenharmony_ci
6896279301Sopenharmony_ci    /**
6996279301Sopenharmony_ci     * Marshal a object into a Parcel.
7096279301Sopenharmony_ci     * @param parcel the object into the parcel
7196279301Sopenharmony_ci     */
7296279301Sopenharmony_ci    virtual bool Marshalling(Parcel &parcel) const override;
7396279301Sopenharmony_ci
7496279301Sopenharmony_ci    /**
7596279301Sopenharmony_ci     * Unmarshal object from a Parcel.
7696279301Sopenharmony_ci     * @return the NotificationTemplate
7796279301Sopenharmony_ci     */
7896279301Sopenharmony_ci    static NotificationTemplate *Unmarshalling(Parcel &parcel);
7996279301Sopenharmony_ci
8096279301Sopenharmony_ciprivate:
8196279301Sopenharmony_ci    /**
8296279301Sopenharmony_ci     * Read a NotificationTemplate object from a Parcel.
8396279301Sopenharmony_ci     * @param parcel the parcel
8496279301Sopenharmony_ci     */
8596279301Sopenharmony_ci    bool ReadFromParcel(Parcel &parcel);
8696279301Sopenharmony_ci
8796279301Sopenharmony_ciprivate:
8896279301Sopenharmony_ci    std::string templateName_;
8996279301Sopenharmony_ci    std::shared_ptr<AAFwk::WantParams> templateData_ {};
9096279301Sopenharmony_ci};
9196279301Sopenharmony_ci}  // namespace Notification
9296279301Sopenharmony_ci}  // namespace OHOS
9396279301Sopenharmony_ci
9496279301Sopenharmony_ci#endif  // BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_INTERFACES_INNER_API_NOTIFICATION_TEMPLATE_H
9596279301Sopenharmony_ci
96