00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_MODEL_H_
00028 #define CEYLAN_MODEL_H_
00029
00030
00031 #include "CeylanCallableEventSource.h"
00032 #include "CeylanCallerEventListener.h"
00033
00034 #include <string>
00035
00036
00037
00038 namespace Ceylan
00039 {
00040
00041
00042
00056 class CEYLAN_DLL MVCEvent : public Event
00057 {
00058
00059
00060 public:
00061
00062
00064 explicit MVCEvent( EventSource & source ) ;
00065
00066
00068 virtual ~MVCEvent() throw() ;
00069
00070
00071
00072 private:
00073
00074
00083 MVCEvent( const MVCEvent & source ) ;
00084
00085
00095 MVCEvent & operator = ( const MVCEvent & source ) ;
00096
00097 } ;
00098
00099
00100
00101
00102
00103 class View ;
00104
00105
00106
00107 class Controller ;
00108
00109
00110
00135 class CEYLAN_DLL Model : public CallableEventSource,
00136 public CallerEventListener
00137 {
00138
00139
00140 public:
00141
00142
00144 explicit Model() ;
00145
00146
00148 virtual ~Model() throw() ;
00149
00150
00151
00158 virtual void addView( View & newView ) ;
00159
00160
00161
00168 virtual void removeView( View & view ) ;
00169
00170
00171
00182 virtual void removeAllViews() ;
00183
00184
00185
00193 virtual void subscribeToController( Controller & newController ) ;
00194
00195
00196
00203 virtual void unsubscribeFromController( Controller & controller ) ;
00204
00205
00206
00211 virtual void unsubscribeFromAllControllers() ;
00212
00213
00214
00225 virtual const std::string toString(
00226 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00227
00228
00229
00230 protected:
00231
00232
00240 virtual void notifyAllViews( const MVCEvent & newMVCEvent ) ;
00241
00242
00243
00244
00245 private:
00246
00247
00256 Model( const Model & source ) ;
00257
00258
00267 Model & operator = ( const Model & source ) ;
00268
00269
00270 } ;
00271
00272 }
00273
00274
00275
00276 #endif // CEYLAN_MODEL_H_
00277