/***************************************************************************
 *                          Zanoza Modeler v2.x                            *
 *      This is unpublished propietary source code of Zanoza Software.     *
 *      The copyright notice does not evidence any actual or intended      *
 *                    publication of such source code.                     *
 *                                                                         *
 *                Copyright (c) 2002-2008 Zanoza Software.                 *
 *                                                                         *
 *                        All rights reserved.                             *
 ***************************************************************************
 *--------------------------------------------------------------------------
 * @author:   Oleg Melashenko
 *--------------------------------------------------------------------------
 * @purpose:  Declaration of the class IViewEventHandler
 *   Handles events in certain view
 *--------------------------------------------------------------------------
 * @created: Sunday, April 06, 2003 12:40:28
 */

#if !defined(IViewEventHandler_h_included)
#define IViewEventHandler_h_included
//forward declaration of this class might require
namespace core
{ namespace events
  { class IViewEventHandler; class CViewEventHandlerCol; }; };
#include <zmodeler.h>
#include <core/events/eventsTypes.h>
#include <core/events/IEventHandler.h>
#include <core/ui/IView.h>


namespace core
{
  namespace events
  {
    
    class IViewEventHandler : public core::events::IEventHandler
    {
    public:
      /* The handler invoked with bDone=true when beginning creation process and
       * with bDone=true after creation process. */
      virtual ZRESULT onCreate(core::ui::IView* pView, bool bDone)=0;
      /* The handler is invoked with bDone=true when beginning close-procedure and
       * with bDone=true after view is closed. */
      virtual ZRESULT onClose(core::ui::IView* pView, bool bDone)=0;
      /* Handles activate/deactivate status */
      virtual ZRESULT onActivation(core::ui::IView* pView, bool bActivate)=0;
      /* Show/Hide/Maximize/Minimize/Resoted states are handled via
       * this handler. showCmd parameter should be compared to SW_
       * commands (SW_SHOW, SW_HIDE, SW_MAXIMIZE, etc). See
       * PlatformSDK: CWnd::ShowWindow() for details; */
      virtual ZRESULT onShow(core::ui::IView* pView, DWORD showCmd)=0;
      /* The handler invoked with bDone=true when beginning rendering and
       * with bDone=true after rendering. */
      virtual ZRESULT onRender(core::ui::IView* pView, bool bDone)=0;
    
    };//class IViewEventHandler
    
    //
    // collection template
    //
    class CViewEventHandlerCol : public ZUnknown,
        public ZIntrCollection<IViewEventHandler>
    {
    public:
      INTERFACE_FUNCTIONS_DEFAULT(CViewEventHandlerCol)
    };//class CViewEventHandlerCol
  };//events
};//core

#endif
