1 
2 ///////////////////////////////////////////////////////////
3 //                                                       //
4 //                         SAGA                          //
5 //                                                       //
6 //      System for Automated Geoscientific Analyses      //
7 //                                                       //
8 //                    User Interface                     //
9 //                                                       //
10 //                    Program: SAGA                      //
11 //                                                       //
12 //-------------------------------------------------------//
13 //                                                       //
14 //                  VIEW_Layout_Info.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 //                Germany                                //
43 //                                                       //
44 //    e-mail:     oconrad@saga-gis.org                   //
45 //                                                       //
46 ///////////////////////////////////////////////////////////
47 
48 //---------------------------------------------------------
49 #ifndef _HEADER_INCLUDED__SAGA_GUI__VIEW_Layout_Info_H
50 #define _HEADER_INCLUDED__SAGA_GUI__VIEW_Layout_Info_H
51 
52 
53 ///////////////////////////////////////////////////////////
54 //														 //
55 //														 //
56 //														 //
57 ///////////////////////////////////////////////////////////
58 
59 //---------------------------------------------------------
60 #include <wx/wx.h>
61 
62 //---------------------------------------------------------
63 #include <saga_gdi/sgdi_layout_items.h>
64 
65 
66 ///////////////////////////////////////////////////////////
67 //														 //
68 //														 //
69 //														 //
70 ///////////////////////////////////////////////////////////
71 
72 //---------------------------------------------------------
73 class CVIEW_Layout_Info
74 {
75 public:
76 	enum
77 	{
78 		Item_Type_Map	= 0,
79 		Item_Type_Scalebar,
80 		Item_Type_Scale,
81 		Item_Type_Legend,
82 		Item_Type_Label,
83 		Item_Type_Text,
84 		Item_Type_Image,
85 		Item_Type_None
86 	};
87 
88 	static const char *				Get_Item_Type_Name		(int Type);
89 
90 
91 	//-----------------------------------------------------
92 	CVIEW_Layout_Info(class CWKSP_Map *pMap);
93 	virtual ~CVIEW_Layout_Info(void);
94 
95 	CSGDI_Layout_Items				m_Items;
96 
Get_Map(void)97 	class CWKSP_Map *				Get_Map					(void)	{	return( m_pMap );	}
98 
99 	wxString						Get_Name				(void);
100 	int								Get_Page_Count			(void);
101 
Get_Parameter(const CSG_String & ID)102 	CSG_Parameter &					Get_Parameter			(const CSG_String &ID)	{	return( m_Parameters[ID] );	}
103 
104 	bool							Properties				(void);
105 
106 	wxSize							Get_PaperSize			(void);
107 	wxRect							Get_Margins				(void);
108 	wxPoint							Get_Margin_TopLeft		(void);
109 	wxPoint							Get_Margin_BottomRight	(void);
110 
111 	bool							Page_Setup				(void);
112 	bool							Print_Setup				(void);
113 	bool							Print					(void);
114 	bool							Print_Preview			(void);
115 
116 	bool							Load					(void);
117 	bool							Load					(const CSG_MetaData &Layout);
118 	bool							Save					(void)	const;
119 	bool							Save					(CSG_MetaData &Layout)	const;
120 
121 	bool							is_Shown				(int Item_Type);
122 	bool							is_Stock				(int Item_Type);
123 	bool							Can_Hide				(class CLayout_Item *pItem = NULL);
124 	bool							Can_Delete				(class CLayout_Item *pItem = NULL);
Get_Item(size_t Index)125 	class CLayout_Item *			Get_Item				(size_t Index)	const	{	return( (CLayout_Item *)m_Items(Index) );	}
126 	bool							Add_Item				(int Item_Type);
127 	class CLayout_Item *			Get_Stock_Item			(int Item_Type);
128 	bool							Toggle_Stock_Item		(int Item_Type);
129 	bool							Toggle_Stock_Item		(class CLayout_Item *pItem = NULL);
130 	bool							Clipboard_Paste			(void);
131 
132 	wxMenu *						Menu_Get_Active			(void);
133 	bool							Menu_On_Command			(wxCommandEvent  &event);
134 	bool							Menu_On_Command_UI		(wxUpdateUIEvent &event);
135 
136 	bool							Set_Zoom				(double Zoom);
137 
Get_Paper2DC(void)138 	double							Get_Paper2DC			(void)					const	{	return(                       m_Paper2DC     );	}
Get_Paper2DC(const wxRect & Rect)139 	wxRect							Get_Paper2DC			(const wxRect &Rect)	const	{	return( Get_Rect_Scaled(Rect, m_Paper2DC   ) );	}
140 
141 	bool							Draw_Paper				(wxDC &dc);
142 	bool							Draw					(wxDC &dc, bool bPrintOut = false);
143 
144 	bool							Export					(void);
145 	bool							Clipboard_Copy			(void);
146 
147 
148 protected:
149 
150 	double							m_Zoom, m_Paper2DC;
151 
152 	CSG_Parameters					m_Parameters;
153 
154 	class CWKSP_Map					*m_pMap;
155 
156 	class wxPrintData				*m_pPrintData;
157 
158 	class wxPageSetupData			*m_pPrintPage;
159 
160 };
161 
162 
163 ///////////////////////////////////////////////////////////
164 //														 //
165 //														 //
166 //														 //
167 ///////////////////////////////////////////////////////////
168 
169 //---------------------------------------------------------
170 #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__VIEW_Layout_Info_H
171