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.

61 lines
1.9 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2017 Chris Pavlina <pavlina.chris@gmail.com>
  5. * Copyright (C) 2014 Henner Zeller <h.zeller@acm.org>
  6. * Copyright (C) 2014-2017 KiCad Developers, see AUTHORS.txt for contributors.
  7. *
  8. * This program is free software: you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation, either version 3 of the License, or (at your
  11. * option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef FP_TREE_MODEL_ADAPTER_H
  22. #define FP_TREE_MODEL_ADAPTER_H
  23. #include <lib_tree_model_adapter.h>
  24. #include <footprint_info.h>
  25. class LIB_TABLE;
  26. class FP_LIB_TABLE;
  27. class FP_TREE_MODEL_ADAPTER : public LIB_TREE_MODEL_ADAPTER
  28. {
  29. public:
  30. /**
  31. * Destructor. Do NOT delete this class manually; it is reference-counted by wxObject.
  32. */
  33. ~FP_TREE_MODEL_ADAPTER();
  34. /**
  35. * Factory function: create a model adapter in a reference-counting container.
  36. *
  37. * @param aLibs library set from which parts will be loaded
  38. */
  39. static PTR Create( LIB_TABLE* aLibs );
  40. void AddLibraries();
  41. wxString GenerateInfo( LIB_ID const& aLibId, int aUnit ) override;
  42. protected:
  43. /**
  44. * Constructor; takes a set of libraries to be included in the search.
  45. */
  46. FP_TREE_MODEL_ADAPTER( LIB_TABLE* aLibs );
  47. std::vector<LIB_TREE_ITEM*> getFootprints( const wxString& aLibName );
  48. FP_LIB_TABLE* m_libs;
  49. };
  50. #endif // FP_TREE_MODEL_ADAPTER_H