Cafu Engine
Select.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_GUIEDITOR_COMMAND_SELECT_HPP_INCLUDED
8 #define CAFU_GUIEDITOR_COMMAND_SELECT_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 #include "Templates/Pointer.hpp"
12 
13 
14 namespace cf { namespace GuiSys { class WindowT; } }
15 
16 
17 namespace GuiEditor
18 {
19  class GuiDocumentT;
20 
21  class CommandSelectT : public CommandT
22  {
23  public:
24 
25  // Named constructors for easier command creation.
26  static CommandSelectT* Clear (GuiDocumentT* GuiDocument);
27  static CommandSelectT* Add (GuiDocumentT* GuiDocument, const ArrayT< IntrusivePtrT<cf::GuiSys::WindowT> >& Windows);
28  static CommandSelectT* Add (GuiDocumentT* GuiDocument, IntrusivePtrT<cf::GuiSys::WindowT> Window);
29  static CommandSelectT* Remove(GuiDocumentT* GuiDocument, const ArrayT< IntrusivePtrT<cf::GuiSys::WindowT> >& Windows);
30  static CommandSelectT* Remove(GuiDocumentT* GuiDocument, IntrusivePtrT<cf::GuiSys::WindowT> Window);
31  static CommandSelectT* Set (GuiDocumentT* GuiDocument, const ArrayT< IntrusivePtrT<cf::GuiSys::WindowT> >& Windows);
32 
33  ~CommandSelectT();
34 
35  // CommandT implementation.
36  bool Do();
37  void Undo();
38  wxString GetName() const;
39 
40 
41  private:
42 
43  // Only named constructors may create this command.
44  CommandSelectT(GuiDocumentT* GuiDocument, const ArrayT< IntrusivePtrT<cf::GuiSys::WindowT> >& OldSelection, const ArrayT< IntrusivePtrT<cf::GuiSys::WindowT> >& NewSelection);
45 
46  GuiDocumentT* m_GuiDocument;
47 
48  const ArrayT< IntrusivePtrT<cf::GuiSys::WindowT> > m_OldSelection;
49  const ArrayT< IntrusivePtrT<cf::GuiSys::WindowT> > m_NewSelection;
50  };
51 }
52 
53 #endif
wxString GetName() const
Returns the name (a description) of the command.
Definition: Select.cpp:136
Definition: Select.hpp:21
bool Do()
This method executes the command.
Definition: Select.cpp:106
Definition: GuiDocument.hpp:39
void Undo()
This method un-does the command.
Definition: Select.cpp:124
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
Definition: Renderer.hpp:16