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.

162 lines
6.1 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 KiCad Developers, see change_log.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 wxTopLevelWindow;
  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 FOOTPRINT_EDIT_FRAME;
  49. class FP_LIB_TABLE;
  50. class BOARD;
  51. class PCB_PLOT_PARAMS;
  52. /**
  53. * Function InvokePcbLibTableEditor
  54. * shows the modal DIALOG_FP_LIB_TABLE for purposes of editing two lib tables.
  55. *
  56. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  57. * @param aGlobal is the common footprint library table file being edited.
  58. * @param aProject is the project specific footprint library table file being edited.
  59. *
  60. * @return int - bits 0 and 1 tell whether a change was made to the @a aGlobal
  61. * and/or the @a aProject table, respectively. If set, table was modified.
  62. */
  63. int InvokePcbLibTableEditor( wxTopLevelWindow* aCaller, FP_LIB_TABLE* aGlobal, FP_LIB_TABLE* aProject );
  64. /**
  65. * Function InvokeFootprintWizard
  66. * Runs the footprint library wizard for easy library addition.
  67. *
  68. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  69. * @param aGlobal is the common footprint library table file being edited. If aGlobal is NULL, then
  70. * it will not be updated.
  71. * @param aProject is the project specific footprint library table file being edited. if aProject
  72. * is NULL, then it will not be updated.
  73. *
  74. * @return int 0 - no changes
  75. * 1 - changes in the global table
  76. * 2 - changes in the project table
  77. * 3 - changes in both tables
  78. */
  79. int InvokeFootprintWizard( wxTopLevelWindow* aParent, FP_LIB_TABLE* aGlobal, FP_LIB_TABLE* aProject );
  80. /**
  81. * Function Invoke3DShapeLibsDownloaderWizard
  82. * Runs the downloader wizard for easy 3D shape libraries download from
  83. * the official Kicad Github repository of *.3Dshape libraries.
  84. *
  85. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  86. */
  87. void Invoke3DShapeLibsDownloaderWizard( wxTopLevelWindow* aParent );
  88. /**
  89. * Function InvokePluginOptionsEditor
  90. * calls DIALOG_FP_PLUGIN_OPTIONS dialog so that plugin options set can be edited.
  91. *
  92. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  93. * @param aNickname is the footprint library whose options are being edited.
  94. * @param aPluginType is something that will pass through IO_MGR::EnumFromStr().
  95. * @param aOptions is the options string on calling into this function.
  96. * @param aResult is where to put the result of the editing.
  97. */
  98. void InvokePluginOptionsEditor( wxTopLevelWindow* aCaller, const wxString& aNickname,
  99. const wxString& aPluginType, const wxString& aOptions, wxString* aResult );
  100. /**
  101. * Function InvokeDXFDialogBoardImport
  102. * shows the modal DIALOG_DXF_IMPORT for importing a DXF file to a board.
  103. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  104. * @return true if the import was made.
  105. */
  106. bool InvokeDXFDialogBoardImport( PCB_BASE_FRAME* aCaller );
  107. /**
  108. * Function InvokeDXFDialogModuleImport
  109. * shows the modal DIALOG_DXF_IMPORT for importing a DXF file as footprint outlines.
  110. *
  111. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  112. * @param aModule is the footprint currently edited.
  113. * @return true if the import was made.
  114. */
  115. bool InvokeDXFDialogModuleImport( PCB_BASE_FRAME* aCaller, MODULE* aModule );
  116. /**
  117. * Function InvokeLayerSetup
  118. * shows the layer setup dialog
  119. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  120. * @param aBoard is the currently edited board.
  121. * @return bool - true if user pressed OK (did not abort), else false.
  122. */
  123. bool InvokeLayerSetup( wxTopLevelWindow* aCaller, BOARD* aBoard );
  124. /**
  125. * Function InvokeSVGPrint
  126. * shows the SVG print dialog
  127. * @param aCaller is the wxTopLevelWindow which is invoking the dialog.
  128. * @param aBoard is the currently edited board.
  129. * @param aSettings is the current pcb plot parameters.
  130. * @return bool - true if user pressed OK (did not abort), else false.
  131. */
  132. bool InvokeSVGPrint( wxTopLevelWindow* aCaller, BOARD* aBoard, PCB_PLOT_PARAMS* aSettings );
  133. /**
  134. * Function InvokeSVGPrint
  135. * shows the SVG print dialog
  136. * @param aCaller is the FOOTPRINT_EDIT_FRAME which is invoking the dialog.
  137. * @return bool - true if user pressed OK (did not abort), else false.
  138. */
  139. bool InvokeFPEditorPrefsDlg( FOOTPRINT_EDIT_FRAME* aCaller );
  140. #endif // INVOKE_A_DIALOG_H_