1 
2 ///////////////////////////////////////////////////////////
3 //                                                       //
4 //                         SAGA                          //
5 //                                                       //
6 //      System for Automated Geoscientific Analyses      //
7 //                                                       //
8 //                    User Interface                     //
9 //                                                       //
10 //                    Program: SAGA                      //
11 //                                                       //
12 //-------------------------------------------------------//
13 //                                                       //
14 //                  wksp_tool_manager.h                  //
15 //                                                       //
16 //          Copyright (C) 2005 by Olaf Conrad            //
17 //                                                       //
18 //-------------------------------------------------------//
19 //                                                       //
20 // This file is part of 'SAGA - System for Automated     //
21 // Geoscientific Analyses'. SAGA is free software; you   //
22 // can redistribute it and/or modify it under the terms  //
23 // of the GNU General Public License as published by the //
24 // Free Software Foundation, either version 2 of the     //
25 // License, or (at your option) any later version.       //
26 //                                                       //
27 // SAGA is distributed in the hope that it will be       //
28 // useful, but WITHOUT ANY WARRANTY; without even the    //
29 // implied warranty of MERCHANTABILITY or FITNESS FOR A  //
30 // PARTICULAR PURPOSE. See the GNU General Public        //
31 // License for more details.                             //
32 //                                                       //
33 // You should have received a copy of the GNU General    //
34 // Public License along with this program; if not, see   //
35 // <http://www.gnu.org/licenses/>.                       //
36 //                                                       //
37 //-------------------------------------------------------//
38 //                                                       //
39 //    contact:    Olaf Conrad                            //
40 //                Institute of Geography                 //
41 //                University of Goettingen               //
42 //                Goldschmidtstr. 5                      //
43 //                37077 Goettingen                       //
44 //                Germany                                //
45 //                                                       //
46 //    e-mail:     oconrad@saga-gis.org                   //
47 //                                                       //
48 ///////////////////////////////////////////////////////////
49 
50 //---------------------------------------------------------
51 #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Tool_Manager_H
52 #define _HEADER_INCLUDED__SAGA_GUI__WKSP_Tool_Manager_H
53 
54 
55 ///////////////////////////////////////////////////////////
56 //														 //
57 //														 //
58 //														 //
59 ///////////////////////////////////////////////////////////
60 
61 //---------------------------------------------------------
62 #include <saga_api/saga_api.h>
63 
64 #include "wksp_base_manager.h"
65 
66 
67 ///////////////////////////////////////////////////////////
68 //														 //
69 //														 //
70 //														 //
71 ///////////////////////////////////////////////////////////
72 
73 //---------------------------------------------------------
74 class CWKSP_Tool_Manager : public CWKSP_Base_Manager
75 {
76 public:
77 	CWKSP_Tool_Manager(void);
78 	virtual ~CWKSP_Tool_Manager(void);
79 
80 	bool							Initialise			(void);
81 	bool							Finalise			(void);
82 
Get_Type(void)83 	virtual TWKSP_Item				Get_Type			(void)		{	return( WKSP_ITEM_Tool_Manager );	}
84 
85 	virtual wxString				Get_Name			(void);
86 	virtual wxString				Get_Description		(void);
87 
88 	virtual wxMenu *				Get_Menu			(void);
89 
90 	virtual bool					On_Command			(int Cmd_ID);
91 	virtual bool					On_Command_UI		(wxUpdateUIEvent &event);
92 
93 	virtual int						On_Parameter_Changed(CSG_Parameters *pParameters, CSG_Parameter *pParameter, int Flags);
94 	virtual void					Parameters_Changed	(void);
95 
96 	void							On_Execute			(wxCommandEvent  &event);
97 	void							On_Execute_UI		(wxUpdateUIEvent &event);
98 
Get_Group(int i)99 	class CWKSP_Tool_Group *		Get_Group			(int i)		{	return( (class CWKSP_Tool_Group *)Get_Item(i) );	}
100 	class CWKSP_Tool_Group *		Get_Group			(const wxString &Group);
101 
102 	class CWKSP_Tool_Library *		Get_Library			(CSG_Tool_Library *pLibrary);
103 
104 	bool							Update				(void);
105 
106 	wxMenu *						Get_Menu_Tools		(void);
107 	void							Set_Recently_Used	(class CWKSP_Tool *pTool);
108 
109 	bool							Do_Beep				(void);
110 
111 	void							Open				(void);
112 	bool							Open				(const wxString &File_Name);
113 
114 	bool							Exists				(class CWKSP_Tool *pTool);
115 
116 	class CWKSP_Tool *				Get_Tool_byID		(int CMD_ID);
117 
118 
119 private:
120 
121 	class CWKSP_Tool_Menu			*m_pMenu_Tools;
122 
123 
124 	bool							_Reload				(void);
125 	bool							_Update				(bool bSyncToCtrl);
126 
127 };
128 
129 //---------------------------------------------------------
130 extern CWKSP_Tool_Manager			*g_pTools;
131 
132 
133 ///////////////////////////////////////////////////////////
134 //														 //
135 ///////////////////////////////////////////////////////////
136 
137 //---------------------------------------------------------
138 class CWKSP_Tool_Group : public CWKSP_Base_Manager
139 {
140 public:
141 	CWKSP_Tool_Group(const wxString &Name);
142 	virtual ~CWKSP_Tool_Group(void);
143 
Get_Type(void)144 	virtual TWKSP_Item				Get_Type			(void)		{	return( WKSP_ITEM_Tool_Group );	}
145 
Get_Name(void)146 	virtual wxString				Get_Name			(void)		{	return( m_Name );	}
147 	virtual wxString				Get_Description		(void);
148 
149 	virtual wxMenu *				Get_Menu			(void);
150 
151 	virtual bool					On_Command			(int Cmd_ID);
152 	virtual bool					On_Command_UI		(wxUpdateUIEvent &event);
153 
154 	bool							Add_Library			(CSG_Tool_Library *pLibrary);
Get_Library(int i)155 	class CWKSP_Tool_Library *		Get_Library			(int i)		{	return( (class CWKSP_Tool_Library *)Get_Item(i) );	}
156 	class CWKSP_Tool_Library *		Get_Library			(CSG_Tool_Library *pLibrary);
157 
158 
159 private:
160 
161 	wxString						m_Name;
162 
163 };
164 
165 
166 ///////////////////////////////////////////////////////////
167 //														 //
168 //														 //
169 //														 //
170 ///////////////////////////////////////////////////////////
171 
172 //---------------------------------------------------------
173 #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Tool_Manager_H
174