/***************************************************************************
 *                          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 IElementController
 *--------------------------------------------------------------------------
 * @created: Thursday, May 06, 2004 12:57:26
 */

#if !defined(IElementController_h_included)
#define IElementController_h_included
//forward declaration of this class might require
namespace core
{ namespace ui
  { namespace controls
    { class IElementController; }; }; };
#include <zmodeler.h>
#include <core/ui/controls/uiControls.h>
#include <core/ui/controls/IUIControl.h>


namespace core
{
  namespace ui
  {
    namespace controls
    {
      
      class IElementController : public ZUnknown
      {
      public:
        virtual ZRESULT onDeploy(core::ui::controls::IUIControl* pControl, long nOrdinal)=0;
        /* Control is about to be destroyed. Control is still valid and it's content
         * is accessible. Returning ZRESULT_FALSE to this message will force
         * control to stay alive. Don't call detach() in respond to this message. */
        virtual ZRESULT onDestroy(void)=0;
        virtual ZRESULT onDelete(long nOrdinal)=0;
        virtual ZRESULT onSetFocus(long nOrdinal)=0;
        virtual ZRESULT onKillFocus(long nOrdinal)=0;
        virtual ZRESULT onLeftClick(long nOrdinal, ZPoint loc)=0;
        virtual ZRESULT onRightClick(long nOrdinal, ZPoint loc)=0;
        /* Notifies on status changing. strValue could be NULL, if status is about to be changed.
         * nSubItem is zero, unless IMultyColumn is supported and sub-item is idited */
        virtual ZRESULT onValueChanging(long nOrdinal, ZString strValue, long nSubItem=0)=0;
        /* Called after chaning status/value to validate new state/value. Parameter can
         * be altered if desired. If strValue is NULL, then the status was changed. */
        virtual ZRESULT onValueChanged(long nOrdinal, ZString& strValue, long nSubItem=0)=0;
      
      };//class IElementController
    };//controls
  };//ui
};//core

#endif
