1e509ee18Sopenharmony_ci/* 2e509ee18Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3e509ee18Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e509ee18Sopenharmony_ci * you may not use this file except in compliance with the License. 5e509ee18Sopenharmony_ci * You may obtain a copy of the License at 6e509ee18Sopenharmony_ci * 7e509ee18Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e509ee18Sopenharmony_ci * 9e509ee18Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e509ee18Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e509ee18Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e509ee18Sopenharmony_ci * See the License for the specific language governing permissions and 13e509ee18Sopenharmony_ci * limitations under the License. 14e509ee18Sopenharmony_ci */ 15e509ee18Sopenharmony_ci 16e509ee18Sopenharmony_ci#ifndef ECMASCRIPT_TOOLING_AGENT_CSS_IMPL_H 17e509ee18Sopenharmony_ci#define ECMASCRIPT_TOOLING_AGENT_CSS_IMPL_H 18e509ee18Sopenharmony_ci 19e509ee18Sopenharmony_ci#include "base/pt_params.h" 20e509ee18Sopenharmony_ci#include "base/pt_returns.h" 21e509ee18Sopenharmony_ci#include "dispatcher.h" 22e509ee18Sopenharmony_ci 23e509ee18Sopenharmony_ci#include "libpandabase/macros.h" 24e509ee18Sopenharmony_ci 25e509ee18Sopenharmony_cinamespace panda::ecmascript::tooling { 26e509ee18Sopenharmony_ciclass CssImpl final { 27e509ee18Sopenharmony_cipublic: 28e509ee18Sopenharmony_ci CssImpl() = default; 29e509ee18Sopenharmony_ci ~CssImpl() = default; 30e509ee18Sopenharmony_ci 31e509ee18Sopenharmony_ci class DispatcherImpl final : public DispatcherBase { 32e509ee18Sopenharmony_ci public: 33e509ee18Sopenharmony_ci DispatcherImpl(ProtocolChannel *channel, std::unique_ptr<CssImpl> css) 34e509ee18Sopenharmony_ci : DispatcherBase(channel), css_(std::move(css)) {} 35e509ee18Sopenharmony_ci ~DispatcherImpl() override = default; 36e509ee18Sopenharmony_ci void Disable(const DispatchRequest &request); 37e509ee18Sopenharmony_ci void Dispatch(const DispatchRequest &request) override; 38e509ee18Sopenharmony_ci 39e509ee18Sopenharmony_ci enum class Method { 40e509ee18Sopenharmony_ci DISABLE, 41e509ee18Sopenharmony_ci UNKNOWN 42e509ee18Sopenharmony_ci }; 43e509ee18Sopenharmony_ci Method GetMethodEnum(const std::string& method); 44e509ee18Sopenharmony_ci 45e509ee18Sopenharmony_ci private: 46e509ee18Sopenharmony_ci NO_COPY_SEMANTIC(DispatcherImpl); 47e509ee18Sopenharmony_ci NO_MOVE_SEMANTIC(DispatcherImpl); 48e509ee18Sopenharmony_ci 49e509ee18Sopenharmony_ci std::unique_ptr<CssImpl> css_ {}; 50e509ee18Sopenharmony_ci }; 51e509ee18Sopenharmony_ci 52e509ee18Sopenharmony_ciprivate: 53e509ee18Sopenharmony_ci NO_COPY_SEMANTIC(CssImpl); 54e509ee18Sopenharmony_ci NO_MOVE_SEMANTIC(CssImpl); 55e509ee18Sopenharmony_ci}; 56e509ee18Sopenharmony_ci} // namespace panda::ecmascript::tooling 57e509ee18Sopenharmony_ci#endif