summaryrefslogtreecommitdiffstats
path: root/src/gui/projectdlgs.h
blob: 56fb58b974ae83593638f11255a456fa1d11ca8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/***************************************************************************
 *   Copyright (C) 2005 by David Saxton                                    *
 *   david@bluehaze.org                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 ***************************************************************************/

#ifndef PROJECTDLGS_H
#define PROJECTDLGS_H

#include <kdialogbase.h>

class CreateSubprojectWidget;
class LinkerOptions;
class LinkerOptionsWidget;
class KURLRequester;
class NewProjectWidget;
class ProcessingOptions;
class ProcessingOptionsWidget;
class ProjectItem;

/**
A standard dialog for getting project details from the user for a new project
@short Dialog for new project details
@author David Saxton
*/
class NewProjectDlg : public KDialogBase
{
	Q_OBJECT
  
	public:
		NewProjectDlg( TQWidget * parent );

	    /**
		 * Called when the 'Cancel' button is pressed.
		 */
		void reject();
    
  	  	/**
		 * Called when the 'OK' button is pressed.
		 * User entered values are read in
		 */
		void accept();
		
		bool accepted() const { return m_bAccepted; }
		TQString projectName() const { return m_projectName; }
		TQString projectLocation() const { return m_projectLocation; }
		TQString location() const { return m_location; }
    
	public slots:
   		 /**
		 * Called when the projectName or projectLocation edit boxes are edited.
		 * Checks whether the resultant location combination is a valid path -
		 * if so, enabels the OK button; otherwise disables it.
		  */
		void locationChanged( const TQString & );

	protected:
		NewProjectWidget * m_pWidget;
		bool m_bAccepted;
		TQString m_projectName;
		TQString m_projectLocation;
		TQString m_location;
};


/**
@author David Saxton
*/
class CreateSubprojectDlg : public KDialogBase
{
	Q_OBJECT
  
	public:
		CreateSubprojectDlg( TQWidget *parent = 0 );
		~CreateSubprojectDlg();
		
		// The following values should agree with the positions in the combo box
		enum Type
		{
			ProgramType = 0,
			LibraryType = 1
		};

	    /**
		 * Called when the 'Cancel' button is pressed.
		 */
		void reject();
  	  	/**
		 * Called when the 'OK' button is pressed. User entered values are read
		 * in.
		 */
		void accept();
		
		bool accepted() const { return m_bAccepted; }
		Type type() const { return m_type; }
		TQString targetFile() const { return m_targetFile; }

	protected:
		CreateSubprojectWidget * m_pWidget;
		bool m_bAccepted;
		Type m_type;
		TQString m_targetFile;
};


/**
@author David Saxton
*/
class LinkerOptionsDlg : public KDialogBase
{
	Q_OBJECT
  
	public:
		LinkerOptionsDlg( LinkerOptions * linkingOptions, TQWidget *parent = 0 );
		virtual ~LinkerOptionsDlg();

	    /**
		 * Called when the 'Cancel' button is pressed.
		 */
		void reject();
  	  	/**
		 * Called when the 'OK' button is pressed. User entered values are read
		 * in.
		 */
		void accept();
		
	protected:
		LinkerOptions * m_pLinkerOptions;
		LinkerOptionsWidget * m_pWidget;
		KURLRequester * m_pExternalLibraryRequester;
};


/**
@author David Saxton
*/
class ProcessingOptionsDlg : public KDialogBase
{
	public:
		ProcessingOptionsDlg( ProjectItem * projectItem, TQWidget *parent = 0 );
		virtual ~ProcessingOptionsDlg();

	    /**
		 * Called when the 'Cancel' button is pressed.
		 */
		void reject();
  	  	/**
		 * Called when the 'OK' button is pressed. User entered values are read
		 * in.
		 */
		void accept();
		
	protected:
		ProjectItem * m_pProjectItem;
		ProcessingOptionsWidget * m_pWidget;
};

#endif