1 /********************************************************** 2 * Version $Id$ 3 *********************************************************/ 4 5 /////////////////////////////////////////////////////////// 6 // // 7 // SAGA // 8 // // 9 // System for Automated Geoscientific Analyses // 10 // // 11 // User Interface // 12 // // 13 // Program: SAGA // 14 // // 15 //-------------------------------------------------------// 16 // // 17 // WKSP_Base_Manager.h // 18 // // 19 // Copyright (C) 2005 by Olaf Conrad // 20 // // 21 //-------------------------------------------------------// 22 // // 23 // This file is part of 'SAGA - System for Automated // 24 // Geoscientific Analyses'. SAGA is free software; you // 25 // can redistribute it and/or modify it under the terms // 26 // of the GNU General Public License as published by the // 27 // Free Software Foundation, either version 2 of the // 28 // License, or (at your option) any later version. // 29 // // 30 // SAGA is distributed in the hope that it will be // 31 // useful, but WITHOUT ANY WARRANTY; without even the // 32 // implied warranty of MERCHANTABILITY or FITNESS FOR A // 33 // PARTICULAR PURPOSE. See the GNU General Public // 34 // License for more details. // 35 // // 36 // You should have received a copy of the GNU General // 37 // Public License along with this program; if not, see // 38 // <http://www.gnu.org/licenses/>. // 39 // // 40 //-------------------------------------------------------// 41 // // 42 // contact: Olaf Conrad // 43 // Institute of Geography // 44 // University of Goettingen // 45 // Goldschmidtstr. 5 // 46 // 37077 Goettingen // 47 // Germany // 48 // // 49 // e-mail: oconrad@saga-gis.org // 50 // // 51 /////////////////////////////////////////////////////////// 52 53 //--------------------------------------------------------- 54 55 56 /////////////////////////////////////////////////////////// 57 // // 58 // // 59 // // 60 /////////////////////////////////////////////////////////// 61 62 //--------------------------------------------------------- 63 #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Base_Manager_H 64 #define _HEADER_INCLUDED__SAGA_GUI__WKSP_Base_Manager_H 65 66 67 /////////////////////////////////////////////////////////// 68 // // 69 // // 70 // // 71 /////////////////////////////////////////////////////////// 72 73 //--------------------------------------------------------- 74 #include "wksp_base_item.h" 75 76 77 /////////////////////////////////////////////////////////// 78 // // 79 // // 80 // // 81 /////////////////////////////////////////////////////////// 82 83 //--------------------------------------------------------- 84 class CWKSP_Base_Manager : public CWKSP_Base_Item 85 { 86 friend class CWKSP_Base_Item; 87 88 public: 89 CWKSP_Base_Manager(void); 90 virtual ~CWKSP_Base_Manager(void); 91 Get_Count(void)92 int Get_Count (void) { return( m_nItems ); } 93 Get_Item(int iItem)94 CWKSP_Base_Item * Get_Item (int iItem) { return( iItem >= 0 && iItem < m_nItems ? m_Items[iItem] : NULL ); } 95 96 int Get_Items_Count (void); 97 98 virtual bool On_Data_Deletion (CSG_Data_Object *pObject); 99 100 bool Move_Top (CWKSP_Base_Item *pItem); 101 bool Move_Bottom (CWKSP_Base_Item *pItem); 102 bool Move_Up (CWKSP_Base_Item *pItem); 103 bool Move_Down (CWKSP_Base_Item *pItem); 104 bool Move_To (CWKSP_Base_Item *pItem, CWKSP_Base_Item *pItem_Dst); 105 106 107 protected: 108 109 bool Add_Item (CWKSP_Base_Item *pItem); 110 bool Del_Item (CWKSP_Base_Item *pItem); 111 bool Del_Item (int iItem); 112 113 114 private: 115 116 int m_nItems, m_Item_ID; 117 118 CWKSP_Base_Item **m_Items; 119 120 }; 121 122 123 /////////////////////////////////////////////////////////// 124 // // 125 // // 126 // // 127 /////////////////////////////////////////////////////////// 128 129 //--------------------------------------------------------- 130 #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__WKSP_Base_Manager_H 131