NullUI.h Source File

Back to the index.

NullUI.h
Go to the documentation of this file.
1 #ifndef NULLUI_H
2 #define NULLUI_H
3 
4 /*
5  * Copyright (C) 2008-2010 Anders Gavare. All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  * 3. The name of the author may not be used to endorse or promote products
16  * derived from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  */
30 
31 #include "UI.h"
32 
33 
34 /**
35  * \brief Dummy UI, which does not do anything.
36  */
37 class NullUI
38  : public UI
39 {
40 public:
41  /**
42  * \brief Constructs a %NullUI.
43  *
44  * @param gxemul Pointer to the owning GXemul instance.
45  */
46  NullUI(GXemul *gxemul);
47 
48  virtual ~NullUI();
49 
50  /**
51  * \brief Does nothing, for the dummy UI.
52  */
53  virtual void Initialize();
54 
55  /**
56  * \brief Does nothing, for the dummy UI.
57  */
58  virtual void UpdateUI();
59 
60  /**
61  * \brief Does nothing, for the dummy UI.
62  */
63  virtual void ShowStartupBanner();
64 
65  /**
66  * \brief Does nothing, for the dummy UI.
67  *
68  * @param msg The message to show. (Ignored.)
69  */
70  virtual void ShowDebugMessage(const string& msg);
71 
72  /**
73  * \brief Does nothing, for the dummy UI.
74  *
75  * @param component A pointer to the Component. (Ignored.)
76  * @param msg The message to show. (Ignored.)
77  */
78  virtual void ShowDebugMessage(Component* component, const string& msg);
79 
80  /**
81  * \brief Does nothing, for the dummy UI.
82  *
83  * @param command The command to show. (Ignored.)
84  */
85  virtual void ShowCommandMessage(const string& command);
86 
87  /**
88  * \brief Does nothing, for the dummy UI.
89  *
90  * @param msg The error message to show. (Ignored.)
91  */
92  virtual void FatalError(const string& msg);
93 
94  /**
95  * \brief Does nothing, for the dummy UI.
96  *
97  * @param inputline The entire input line. (Ignored.)
98  * @param cursorPosition The current cursor position. 0 is at the
99  * leftmost position. (Ignored.)
100  */
101  virtual void RedisplayInputLine(const string& inputline,
102  size_t cursorPosition);
103 
104  /**
105  * \brief Executed by the CommandInterpreter when a line has been
106  * completed (with a newline).
107  *
108  * For the %NullUI, this is ignored.
109  */
110  virtual void InputLineDone();
111 
112  /**
113  * \brief Runs the main loop. Ignored by the NullUI.
114  *
115  * The NullUI returns 0 immediately.
116  */
117  virtual int MainLoop();
118 
119  virtual void Shutdown();
120 };
121 
122 
123 #endif // NULLUI_H
virtual void RedisplayInputLine(const string &inputline, size_t cursorPosition)
Does nothing, for the dummy UI.
Definition: NullUI.cc:78
virtual void Shutdown()
Shuts down the UI.
Definition: NullUI.cc:88
virtual void ShowCommandMessage(const string &command)
Does nothing, for the dummy UI.
Definition: NullUI.cc:68
Dummy UI, which does not do anything.
Definition: NullUI.h:37
virtual int MainLoop()
Runs the main loop. Ignored by the NullUI.
Definition: NullUI.cc:93
NullUI(GXemul *gxemul)
Constructs a NullUI.
Definition: NullUI.cc:32
The main emulator class.
Definition: GXemul.h:54
virtual void InputLineDone()
Executed by the CommandInterpreter when a line has been completed (with a newline).
Definition: NullUI.cc:83
virtual void ShowDebugMessage(const string &msg)
Does nothing, for the dummy UI.
Definition: NullUI.cc:58
A Component is a node in the configuration tree that makes up an emulation setup. ...
Definition: Component.h:62
virtual ~NullUI()
Definition: NullUI.cc:38
virtual void Initialize()
Does nothing, for the dummy UI.
Definition: NullUI.cc:43
virtual void UpdateUI()
Does nothing, for the dummy UI.
Definition: NullUI.cc:53
Base class for a User Interface.
Definition: UI.h:40
virtual void FatalError(const string &msg)
Does nothing, for the dummy UI.
Definition: NullUI.cc:73
virtual void ShowStartupBanner()
Does nothing, for the dummy UI.
Definition: NullUI.cc:48

Generated on Fri Dec 7 2018 19:52:23 for GXemul by doxygen 1.8.13