You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.7 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2023 Jon Evans <jon@craftyjon.com>
  5. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software: you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation, either version 3 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef KICAD_API_HANDLER_COMMON_H
  21. #define KICAD_API_HANDLER_COMMON_H
  22. #include <google/protobuf/empty.pb.h>
  23. #include <api/api_handler.h>
  24. #include <api/common/commands/base_commands.pb.h>
  25. #include <api/common/commands/project_commands.pb.h>
  26. using namespace kiapi::common;
  27. using google::protobuf::Empty;
  28. class API_HANDLER_COMMON : public API_HANDLER
  29. {
  30. public:
  31. API_HANDLER_COMMON();
  32. ~API_HANDLER_COMMON() override {}
  33. private:
  34. HANDLER_RESULT<commands::GetVersionResponse> handleGetVersion(
  35. const HANDLER_CONTEXT<commands::GetVersion>& aCtx );
  36. HANDLER_RESULT<commands::PathResponse> handleGetKiCadBinaryPath(
  37. const HANDLER_CONTEXT<commands::GetKiCadBinaryPath>& aCtx );
  38. HANDLER_RESULT<commands::NetClassesResponse> handleGetNetClasses(
  39. const HANDLER_CONTEXT<commands::GetNetClasses>& aCtx );
  40. HANDLER_RESULT<Empty> handleSetNetClasses(
  41. const HANDLER_CONTEXT<commands::SetNetClasses>& aCtx );
  42. HANDLER_RESULT<Empty> handlePing( const HANDLER_CONTEXT<commands::Ping>& aCtx );
  43. HANDLER_RESULT<types::Box2> handleGetTextExtents(
  44. const HANDLER_CONTEXT<commands::GetTextExtents>& aCtx );
  45. HANDLER_RESULT<commands::GetTextAsShapesResponse> handleGetTextAsShapes(
  46. const HANDLER_CONTEXT<commands::GetTextAsShapes>& aCtx );
  47. HANDLER_RESULT<commands::ExpandTextVariablesResponse> handleExpandTextVariables(
  48. const HANDLER_CONTEXT<commands::ExpandTextVariables>& aCtx );
  49. HANDLER_RESULT<commands::StringResponse> handleGetPluginSettingsPath(
  50. const HANDLER_CONTEXT<commands::GetPluginSettingsPath>& aCtx );
  51. HANDLER_RESULT<project::TextVariables> handleGetTextVariables(
  52. const HANDLER_CONTEXT<commands::GetTextVariables>& aCtx );
  53. HANDLER_RESULT<Empty> handleSetTextVariables(
  54. const HANDLER_CONTEXT<commands::SetTextVariables>& aCtx );
  55. };
  56. #endif //KICAD_API_HANDLER_COMMON_H