class_footprint_wizard.h 3.98 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
/**
 * @file  pcbnew_footprint_wizards.h
 * @brief Class PCBNEW_FOOTPRINT_WIZARDS
 */

#ifndef CLASS_FOOTPRINT_WIZARD_H
#define	CLASS_FOOTPRINT_WIZARD_H
#include <vector>
#include <wxPcbStruct.h>

11 12
/**
 * Class FOOTPRINT_WIZARD
13
 * This is the parent class from where any footprint wizard class must
14 15 16 17 18 19 20
 * derive */
class FOOTPRINT_WIZARD
{

public:
    FOOTPRINT_WIZARD() {}
    ~FOOTPRINT_WIZARD() {}
21 22

    /**
23 24 25
     * Function GetName
     * @return the name of the wizard
     */
26
    virtual wxString      GetName()=0;
27

28 29 30 31
    /**
     * Function GetImage
     * @return an svg image of the wizard to be rendered
     */
32 33
    virtual wxString      GetImage()=0;

34 35
    /**
     * Function GetDescription
36
     * @return a description of the footprint wizard
37
     */
38
    virtual wxString      GetDescription()=0;
39 40

    /**
41 42 43
     * Function GetNumParameterPages
     * @return the number of parameter pages that this wizard will show to the user
     */
44
    virtual int           GetNumParameterPages()=0;
45

46 47 48 49 50
    /**
     * Function GetParameterPageName
     * @param aPage is the page we want the name of
     * @return a string with the page name
     */
51
    virtual wxString      GetParameterPageName(int aPage)=0;
52

53 54 55
    /**
     * Function GetParameterNames
     * @param aPage is the page we want the parameter names of
56
     * @return an array string with the parameter names on a certain page
57
     */
58
    virtual wxArrayString GetParameterNames(int aPage)=0;
59

60 61 62 63 64 65 66
    /**
     * Function GetParameterTypes
     * @param aPage is the page we want the parameter types of
     * @return an array string with the parameter types on a certain page
     *          "IU" for internal units, "UNITS" for units (0,1,2,3...,N)
     */
    virtual wxArrayString GetParameterTypes(int aPage)=0;
67 68


69 70 71 72 73
    /**
     * Function GetParameterValues
     * @param aPage is the page we want the parameter values of
     * @return an array of parameter values
     */
74
    virtual wxArrayString GetParameterValues(int aPage)=0;
75

76 77
    /**
     * Function GetParameterErrors
78
     * @param aPage is the page we want to know the errors of
79 80
     * @return an array of errors (if any) for the parameters, empty strings for OK parameters
     */
81
    virtual wxArrayString GetParameterErrors(int aPage)=0;
82

83 84 85 86 87 88
    /**
     * Function SetParameterValues
     * @param aPage is the page we want to set the parameters in
     * @param aValues are the values we want to set into the parameters
     * @return an array of parameter values
     */
89
    virtual wxString      SetParameterValues(int aPage,wxArrayString& aValues)=0;
90 91

    /**
92
     * Function GetModule
93
     * This method builds the module itself and returns it to the caller function
94 95
     * @return  PCB module built from the parameters given to the class
     */
96
    virtual MODULE       *GetModule()=0;
97

98 99 100 101
    /**
     * Function register_wizard
     * It's the standard method of a "FOOTPRINT_WIZARD" to register itself into
     * the FOOTPRINT_WIZARDS singleton manager
102
     *
103
     */
104
    void register_wizard();
105

106 107 108
};


109
class FOOTPRINT_WIZARDS
110 111 112 113 114
{
private:
    static    std::vector<FOOTPRINT_WIZARD*>  m_FootprintWizards;

public:
115

116 117 118 119
    /**
     * Function register_wizard
     * A footprint wizard calls this static method when it wants to register itself
     * into the system wizards
120
     *
121
     * @param aWizard is the footprint wizard to be registered
122
     *
123
     */
124 125
    static void register_wizard(FOOTPRINT_WIZARD *aWizard);

126 127
    /**
     * Function GetWizard
128
     * @param aName is the footprint wizard name
129
     * @return a wizard object by it's name or NULL if it isn't available.
130
     *
131
     */
132
    static FOOTPRINT_WIZARD* GetWizard(wxString aName);
133

134 135 136
    /**
     * Function GetWizard
     * @return a wizard object by it's number or NULL if it isn't available.
137 138
     * @param  aIndex is the wizard index in list
     *
139
     */
140 141 142
    static FOOTPRINT_WIZARD* GetWizard( int aIndex );

    /**
143 144 145
     * Function GetSize
     * @return the number of wizards available into the system
     */
146
    static int GetSize();
147 148 149 150 151

};

#endif	/* PCBNEW_FOOTPRINT_WIZARDS_H */