Lumiera  0.pre.03
»edit your freedom«
gui-notification-facade.h
Go to the documentation of this file.
1 /*
2  GUI-NOTIFICATION-FACADE.h - access point for pushing information into the GUI
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
39 #ifndef STAGE_GUI_NOTIFICATION_H
40 #define STAGE_GUI_NOTIFICATION_H
41 
42 
43 
44 #ifdef __cplusplus /* ============== C++ Interface ================= */
45 
46 #include "lib/depend.hpp"
47 #include "lib/idi/entry-id.hpp"
48 
49 #include <string>
50 
51 
52 namespace lib {
53  namespace diff {
54  class GenNode;
55  class MutationMessage;
56 } }
57 namespace stage {
58 
59  using std::string;
60  using lib::diff::GenNode;
62 
63  using ID = lib::idi::BareEntryID const&;
64 
65  enum NotifyLevel {
69  };
70 
71 
72  /*****************************************************************/
83  {
84  protected:
85  virtual ~GuiNotification() {}
86  friend class lib::DependencyFactory<GuiNotification>;
87 
88  public:
90 
91 
93  virtual void displayInfo (NotifyLevel, string const& text) =0;
94 
96  virtual void markError (ID uiElement, string const& text) =0;
97 
99  virtual void markNote (ID uiElement, string const& text) =0;
100 
102  virtual void mark (ID uiElement, GenNode&& stateMark) =0;
103 
113  virtual void mutate (ID uiElement, MutationMessage&&) =0;
114 
121  virtual void triggerGuiShutdown (string const& cause) =0;
122 
123  };
124 
125 
126 
127 } // namespace stage
128 
129 
130 extern "C" {
131 #endif /* =========================== CL Interface ===================== */
132 
133 
134 #include "common/interface.h"
135 #include "lib/hash-value.h"
136 
137 
138 LUMIERA_INTERFACE_DECLARE (lumieraorg_GuiNotification, 0,
139  LUMIERA_INTERFACE_SLOT (void, displayInfo, (uint, const char*)),
140  LUMIERA_INTERFACE_SLOT (void, markError, (const void*, const char*)),
141  LUMIERA_INTERFACE_SLOT (void, markNote, (const void*, const char*)),
142  LUMIERA_INTERFACE_SLOT (void, mark, (const void*, void*)),
143  LUMIERA_INTERFACE_SLOT (void, mutate, (const void*, void*)),
144  LUMIERA_INTERFACE_SLOT (void, triggerGuiShutdown, (const char*)),
145 );
146 
147 
148 #ifdef __cplusplus
149 }// extern "C"
150 #endif
151 #endif /*STAGE_GUI_NOTIFICATION_H*/
type erased baseclass for building a combined hash and symbolic ID.
Definition: entry-id.hpp:142
#define LUMIERA_INTERFACE_DECLARE(name, version,...)
Declare an interface.
Definition: interface.h:163
something to be aware of, to be indicated unobtrusively
Opaque message to effect a structural change on a target, which is likewise only known in an abstract...
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
Implementation namespace for support and library code.
Lumiera interface macros and structures.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
virtual ~GuiNotification()
this is an interface
Singleton services and Dependency Injection.
Hash value types and utilities.
Global access point to push state update and notification of events from the lower layers into the Lu...
Helper to abstract creation and lifecycle of a dependency.
Definition: depend.hpp:134
Bare symbolic and hash ID used for accounting of asset like entries.
severe condition to be indicated prominently
static lib::Depend< GuiNotification > facade
static storage for the facade access front-end
possibly interesting info that can be safely ignored
generic data element node within a tree
Definition: gen-node.hpp:231