PureMVC PureMVC

include/PureMVC/Interfaces/IView.hpp

Go to the documentation of this file.
00001 //  IView.hpp
00002 //  PureMVC_C++
00003 //
00004 //  PureMVC Port to C++ by Tang Khai Phuong <phuong.tang@puremvc.org>
00005 //  PureMVC - Copyright(c) 2006-2011 Futurescale, Inc., Some rights reserved.
00006 //  Your reuse is governed by the Creative Commons Attribution 3.0 License
00007 //
00008 
00009 #if !defined(__PUREMVC_INTERFACES_IVIEW_HPP__)
00010 #define __PUREMVC_INTERFACES_IVIEW_HPP__
00011 
00012 // STL include
00013 #include <string>
00014 // PureMVC include
00015 #if !defined(__PUREMVC_HPP__)
00016 #define __PUREMVC_INCLUDE__
00017 #include "../PureMVC.hpp"
00018 #endif /* __PUREMVC_HPP__ */
00019 
00020 #include "INotification.hpp"
00021 #include "IObserver.hpp"
00022 #include "IMediator.hpp"
00023 #include "IAggregate.hpp"
00024 
00025 namespace PureMVC
00026 {
00027     namespace Interfaces
00028     {
00052         struct PUREMVC_API IView
00053         {
00054             typedef std::auto_ptr<IAggregate<std::string> > MediatorNames;
00055 
00063             virtual void registerObserver(std::string const& notification_name, IObserver* observer) = 0;
00064 
00071             virtual void removeObserver(std::string const& notification_name, IObserver const* notify_context) = 0;
00072 
00083             virtual void notifyObservers(INotification const& notification) = 0;
00084 
00101             virtual void registerMediator(IMediator* mediator) = 0;
00102 
00109             virtual IMediator const& retrieveMediator(std::string const& mediator_name) const = 0;
00110 
00117             virtual IMediator& retrieveMediator(std::string const& mediator_name) = 0;
00118 
00125             virtual IMediator* removeMediator(std::string const& mediator_name) = 0;
00126 
00133             virtual bool hasMediator(std::string const& mediator_name) const = 0;
00134 
00140             virtual MediatorNames listMediatorNames(void) const = 0;
00141 
00145             virtual ~IView(void);
00146         };
00147     }
00148 }
00149 
00150 #endif /* __PUREMVC_INTERFACES_IVIEW_HPP__ */