/***************************************************************************
 *                          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 IView
 *   View is the rectangular area with some controls/content drawn in it. View
 *   can be of some specific kind (viewport: top/left/user/4d etc). View allows
 *   different controls to lay in.
 *   IView transparenly derieved from:
 *     core::IStatus
 *     core::events::IMouseEventHandler
 *     core::events::IEventDispatcher (EVENT_VIEW)
 *   IView indirectly inherits (contains):
 *     services::IMenuService
 *   and embedds:
 *     core::ui::IViewport
 *--------------------------------------------------------------------------
 * @created: Saturday, January 18, 2003 16:50:50
 */

#if !defined(IView_h_included)
#define IView_h_included
//forward declaration of this class might require
namespace core
{ namespace ui
  { class IView; class CViewCol; }; };
#include <zmodeler.h>
#include <core/ui/uiTypes.h>
#include <core/ui/IVisualControl.h>
#include <core/ui/IViewport.h>


namespace core
{
  namespace ui
  {
    
    class IView : public ZUnknown
    {
    public:
      /* Provides parent CWnd's class pointer */
      virtual ZRESULT getParentWnd(CWnd** ppWnd)=0;
      virtual ZRESULT setParentWnd(CWnd* pWnd)=0;
      /* adds control to dock at specified pane (use ZM_UI_DOCK_xxx) definitions */
      virtual ZRESULT addControl(core::ui::IVisualControl* pControl, long nPane)=0;
      /* Sets enumeration of controls. Pane uses ZM_UI_DOCK_xxx macros */
      virtual ZRESULT setControls(long nPane, CVisualControlCol* pCol)=0;
      /* Provides enumeration of controls. Pane uses ZM_UI_DOCK_xxx macros */
      virtual ZRESULT getControls(long nPane, CVisualControlCol** ppCol)=0;
      virtual ZRESULT recalcLayout(ZRect rect)=0;
      /* Called by framework when redraw of view was requested. */
      virtual ZRESULT redraw(void)=0;
      virtual ZRESULT show(CDC* pDC)=0;
      virtual ZRESULT getExtents(ZRect& rectExtents)=0;
      /* Provides rectangle area occupied by client (viewport) */
      virtual ZRESULT getClientExtents(ZRect& rect)=0;
      virtual ZRESULT getViewport(core::ui::IViewport** ppViewport)=0;
      virtual ZRESULT setViewport(core::ui::IViewport* pViewport)=0;
    
    };//class IView
    
    //
    // collection template
    //
    class CViewCol : public ZUnknown,
        public ZIntrCollection<IView>
    {
    public:
      INTERFACE_FUNCTIONS_DEFAULT(CViewCol)
    };//class CViewCol
  };//ui
};//core

#endif
