Version: 0.6.0
gxselection.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGxSelection class. Selection of IGxObjects in tree or list views
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009,2011,2012 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 
23 #include "wxgis/catalogui/catalogui.h"
24 
25 
30 class WXDLLIMPEXP_GIS_CLU wxGxSelection :
32 {
33 public:
34  enum wxGISEnumInitiators
35  {
36  INIT_ALL = -2,
37  INIT_NONE = -1
38  } Initiator;
39 public:
40  wxGxSelection(void);
41  virtual ~wxGxSelection(void);
42  //IGxSelection
43  virtual void Select( long nObjectId, bool appendToExistingSelection, long nInitiator );
44  virtual void Select( long nObjectId );
45  virtual void Unselect( long nObjectId, long nInitiator );
46  virtual void Clear(long nInitiator);
47  virtual size_t GetCount(void);
48  virtual size_t GetCount(long nInitiator);
49  virtual long GetSelectedObjectId(size_t nIndex);
50  virtual long GetSelectedObjectId(long nInitiator, size_t nIndex);
51  virtual long GetLastSelectedObjectId(void);
52  virtual long GetFirstSelectedObjectId(void);
53  virtual void SetInitiator(long nInitiator);
54  virtual void Do( long nObjectId );
55  virtual bool CanRedo();
56  virtual bool CanUndo();
57  virtual long Redo(int nPos = wxNOT_FOUND);
58  virtual long Undo(int nPos = wxNOT_FOUND);
59  virtual void RemoveDo(long nObjectId);
60  virtual void Reset();
61  virtual size_t GetDoSize();
62  virtual int GetDoPos(void) const { return m_nPos; };
63  virtual long GetDoId(size_t nIndex);
64  virtual wxArrayLong GetDoArray(void) const { return m_DoArray; };
65 protected:
66  wxArrayLong m_DoArray;
67  int m_nPos;
68  bool m_bDoOp;
69 
70  long m_pPrevId;
71  wxCriticalSection m_DoCritSect, m_CritSect;
72 
73  std::map<long, wxArrayLong> m_SelectionMap;
74  long m_currentInitiator;
75 };
76 
80 class WXDLLIMPEXP_GIS_CLU wxGxApplicationBase
81 {
82 public:
83  wxGxApplicationBase(void);
84  virtual ~wxGxApplicationBase(void);
85  wxGxSelection* const GetGxSelection(void);
86  wxGxSelection* const GetGxSelection(void) const;
87  virtual void SetLocation(const wxString &sPath);
88  virtual void Undo(int nPos);
89  virtual void Redo(int nPos);
90 protected:
91  wxGxSelection* m_pSelection;
92 };
An Interface class for GxApplication.
Definition: gxselection.h:80
Definition: pointer.h:34
The GxObject Selection class.
Definition: gxselection.h:30