File indexing completed on 2024-04-21 05:43:42

0001 /***************************************************************************
0002  *   Copyright (C) 2005 by David Saxton                                    *
0003  *   david@bluehaze.org                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #ifndef PROJECTDLGS_H
0012 #define PROJECTDLGS_H
0013 
0014 #include <QDialog>
0015 
0016 class CreateSubprojectWidget;
0017 class LinkerOptions;
0018 class LinkerOptionsWidget;
0019 class KUrlRequester;
0020 class NewProjectWidget;
0021 class ProcessingOptions;
0022 class ProcessingOptionsWidget;
0023 class ProjectItem;
0024 class QDialogButtonBox;
0025 
0026 /**
0027 A standard dialog for getting project details from the user for a new project
0028 @short Dialog for new project details
0029 @author David Saxton
0030 */
0031 class NewProjectDlg : public QDialog
0032 {
0033     Q_OBJECT
0034 public:
0035     NewProjectDlg(QWidget *parent);
0036 
0037     /**
0038      * Called when the 'OK' button is pressed.
0039      * User entered values are read in
0040      */
0041     void accept() override;
0042 
0043     QString projectName() const
0044     {
0045         return m_projectName;
0046     }
0047     QString projectLocation() const
0048     {
0049         return m_projectLocation;
0050     }
0051     QString location() const
0052     {
0053         return m_location;
0054     }
0055 
0056 public slots:
0057     /**
0058      * Called when the projectName or projectLocation edit boxes are edited.
0059      * Checks whether the resultant location combination is a valid path -
0060      * if so, enabels the OK button; otherwise disables it.
0061      */
0062     void locationChanged(const QString &);
0063 
0064 protected:
0065     NewProjectWidget *m_pWidget;
0066     QDialogButtonBox *m_buttonBox;
0067     QString m_projectName;
0068     QString m_projectLocation;
0069     QString m_location;
0070 };
0071 
0072 /**
0073 @author David Saxton
0074 */
0075 class CreateSubprojectDlg : public QDialog
0076 {
0077     Q_OBJECT
0078 public:
0079     CreateSubprojectDlg(QWidget *parent = nullptr);
0080     ~CreateSubprojectDlg() override;
0081 
0082     // The following values should agree with the positions in the combo box
0083     enum Type { ProgramType = 0, LibraryType = 1 };
0084 
0085     /**
0086      * Called when the 'OK' button is pressed. User entered values are read
0087      * in.
0088      */
0089     void accept() override;
0090 
0091     Type type() const
0092     {
0093         return m_type;
0094     }
0095     QString targetFile() const
0096     {
0097         return m_targetFile;
0098     }
0099 
0100 protected:
0101     CreateSubprojectWidget *m_pWidget;
0102     Type m_type;
0103     QString m_targetFile;
0104 };
0105 
0106 /**
0107 @author David Saxton
0108 */
0109 class LinkerOptionsDlg : public QDialog
0110 {
0111     Q_OBJECT
0112 public:
0113     LinkerOptionsDlg(LinkerOptions *linkingOptions, QWidget *parent = nullptr);
0114     ~LinkerOptionsDlg() override;
0115 
0116     /**
0117      * Called when the 'OK' button is pressed. User entered values are read
0118      * in.
0119      */
0120     void accept() override;
0121 
0122 protected:
0123     LinkerOptions *m_pLinkerOptions;
0124     LinkerOptionsWidget *m_pWidget;
0125     KUrlRequester *m_pExternalLibraryRequester;
0126 };
0127 
0128 /**
0129 @author David Saxton
0130 */
0131 class ProcessingOptionsDlg : public QDialog
0132 {
0133 public:
0134     ProcessingOptionsDlg(ProjectItem *projectItem, QWidget *parent = nullptr);
0135     ~ProcessingOptionsDlg() override;
0136 
0137     /**
0138      * Called when the 'OK' button is pressed. User entered values are read
0139      * in.
0140      */
0141     void accept() override;
0142 
0143 protected:
0144     ProjectItem *m_pProjectItem;
0145     ProcessingOptionsWidget *m_pWidget;
0146 };
0147 
0148 #endif