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.

124 lines
4.4 KiB

  1. /**
  2. * @file invoke_pcb_dialog.h
  3. */
  4. /* This program source code file is part of KiCad, a free EDA CAD application.
  5. *
  6. * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  7. * Copyright (C) 2013-2018 KiCad Developers, see AUTHORS.txt for contributors.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. // This header is an insolation layer between top most frames and any number of
  27. // DIALOG classes which can be called from a frame window.
  28. // It is a place to put invocation functions for [modal] dialogs, with benefits:
  29. //
  30. // 1) The information about each dialog class is not exposed to the frame.
  31. // So therefore the DIALOG class can often be kept out of a header file entirely.
  32. //
  33. // 2) The information about the calling frame is not necessarily exposed to
  34. // to the called dialog class, at least not in here.
  35. // The actual InvokeDialog<class>() function is usually coded at the bottom of the
  36. // DIALOG_<class>.cpp file.
  37. #ifndef INVOKE_A_DIALOG_H_
  38. #define INVOKE_A_DIALOG_H_
  39. class wxWindow;
  40. class wxPoint;
  41. class wxSize;
  42. class wxString;
  43. class BOARD;
  44. class MODULE;
  45. // Often this is not used in the prototypes, since wxFrame is good enough and would
  46. // represent maximum information hiding.
  47. class PCB_BASE_FRAME;
  48. class PCB_EDIT_FRAME;
  49. class FOOTPRINT_EDIT_FRAME;
  50. class FP_LIB_TABLE;
  51. class BOARD;
  52. class PCB_PLOT_PARAMS;
  53. class KIWAY;
  54. /**
  55. * Function InvokePcbLibTableEditor
  56. * shows the modal DIALOG_FP_LIB_TABLE for purposes of editing the global and project
  57. * library tables.
  58. *
  59. * @param aCaller is the wxWindow which is invoking the dialog.
  60. * @return true if either table changed.
  61. */
  62. void InvokePcbLibTableEditor( KIWAY* aKiway, wxWindow* aCaller );
  63. /**
  64. * Function Invoke3DShapeLibsDownloaderWizard
  65. * Runs the downloader wizard for easy 3D shape libraries download from
  66. * the official Kicad Github repository of *.3Dshape libraries.
  67. *
  68. * @param aCaller is the wxWindow which is invoking the dialog.
  69. */
  70. void Invoke3DShapeLibsDownloaderWizard( wxWindow* aCaller );
  71. /**
  72. * Function InvokePluginOptionsEditor
  73. * calls DIALOG_FP_PLUGIN_OPTIONS dialog so that plugin options set can be edited.
  74. *
  75. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  76. * @param aNickname is the footprint library whose options are being edited.
  77. * @param aPluginType is something that will pass through IO_MGR::EnumFromStr().
  78. * @param aOptions is the options string on calling into this function.
  79. * @param aResult is where to put the result of the editing.
  80. */
  81. void InvokePluginOptionsEditor( wxWindow* aCaller, const wxString& aNickname,
  82. const wxString& aPluginType, const wxString& aOptions, wxString* aResult );
  83. /**
  84. * Shows the modal DIALOG_IMPORT_GFX for importing a DXF file to a board.
  85. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  86. * @return true if the import was made.
  87. */
  88. bool InvokeDialogImportGfxBoard( PCB_BASE_FRAME* aCaller );
  89. /**
  90. * shows the modal DIALOG_IMPORT_GFX for importing a DXF file as footprint outlines.
  91. *
  92. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  93. * @param aModule is the footprint currently edited.
  94. * @return true if the import was made.
  95. */
  96. bool InvokeDialogImportGfxModule( PCB_BASE_FRAME* aCaller, MODULE* aModule );
  97. /**
  98. * Function InvokeExportSVG
  99. * shows the Export SVG dialog
  100. * @param aCaller is the PCB_BASE_FRAME which is invoking the dialog.
  101. * @param aBoard is the currently edited board.
  102. * @return bool - true if user pressed OK (did not abort), else false.
  103. */
  104. bool InvokeExportSVG( PCB_BASE_FRAME* aCaller, BOARD* aBoard );
  105. #endif // INVOKE_A_DIALOG_H_