Geodesy MapControl
MapControlEvents.h
// Copyright 2010 ESRI
// 
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
// 
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
// 
// See the use restrictions.
// 



#ifndef __MAPCONTROLEVENTS2_H_
#define __MAPCONTROLEVENTS2_H_
#include <ArcSDK.h>
#include <Ao/AoControls.h>
#include <olb/esridefensesolutions.h>

extern IMapControl3Ptr    m_ipMapControl;

class MapControlEvents : public IMapControlEvents2Helper
{
 public:

  HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj) { return S_OK; }
  ULONG   __stdcall AddRef()                                   { return 0;    }
  ULONG   __stdcall Release()                                  { return 0;    }


#if defined(ESRI_UNIX)
    // IMapControlEvents2
    void OnAfterDraw( VARIANT display, long viewDrawPhase);
    void OnAfterScreenDraw( long hdc);
    void OnBeforeScreenDraw( long hdc);
    void OnDoubleClick( long button, long shift, long x, long y,
                        double mapX,double mapY);
    void OnExtentUpdated( VARIANT displayTransformation,
                          VARIANT_BOOL sizeChanged, VARIANT newEnvelope);
    void OnFullExtentUpdated( VARIANT displayTransformation,
                              VARIANT newEnvelope);
    void OnKeyDown( long keyCode, long shift);
    void OnKeyUp( long keyCode, long shift);
    void OnMapReplaced( VARIANT newMap);
    void OnMouseDown( long button, long shift, long x, long y,
                      double mapX, double mapY);
    void OnMouseMove( long button, long shift, long x, long y,
                      double mapX, double mapY);
    void OnMouseUp( long button, long shift, long x, long y,
                    double mapX, double mapY);
    void OnOleDrop( esriControlsDropAction dropAction, VARIANT dataObjectHelper,
                    long* effect, long button, long shift, long x, long y);
    void OnSelectionChanged();
    void OnViewRefreshed( VARIANT ActiveView, long viewDrawPhase,
                          VARIANT layerOrElement, VARIANT envelope);

#elif defined(ESRI_WINDOWS)
    // IMapControlEvents2
    virtual void __stdcall OnAfterDraw(VARIANT display, long viewDrawPhase);
    virtual void __stdcall OnAfterScreenDraw(long hdc);
    virtual void __stdcall OnBeforeScreenDraw(long hdc);
    virtual void __stdcall OnDoubleClick(long button, long shift, long x, long y,
                     double mapX,double mapY);
    virtual void __stdcall OnExtentUpdated(VARIANT displayTransformation,
                       VARIANT_BOOL sizeChanged, VARIANT newEnvelope);
    virtual void __stdcall OnFullExtentUpdated(VARIANT displayTransformation,
                           VARIANT newEnvelope);
    virtual void __stdcall OnKeyDown(long keyCode, long shift);
    virtual void __stdcall OnKeyUp(long keyCode, long shift);
    virtual void __stdcall OnMapReplaced(VARIANT newMap);
    virtual void __stdcall OnMouseDown(long button, long shift, long x, long y,
                   double mapX, double mapY);
    virtual void __stdcall OnMouseMove(long button, long shift, long x, long y,
                   double mapX, double mapY);
    virtual void __stdcall OnMouseUp(long button, long shift, long x, long y,
                 double mapX, double mapY);
    virtual void __stdcall OnOleDrop(esriControlsDropAction dropAction, VARIANT dataObjectHelper,
                 long* effect, long button, long shift, long x, long y);
    virtual void __stdcall OnSelectionChanged();
    virtual void __stdcall OnViewRefreshed(VARIANT ActiveView, long viewDrawPhase,
                       VARIANT layerOrElement, VARIANT envelope);

#endif

    //custom method
    void drawElement(IElement* ipElement);

};

#endif // __MAPCONTROLEVENTS2_H_