GME  13
BoxDecoratorImpl.h
Go to the documentation of this file.
00001 //################################################################################################
00002 //
00003 // Box Decorator COM side Implementation
00004 //      BoxDecoratorImpl.h
00005 //
00006 //################################################################################################
00007 
00008 #ifndef __BOXDECORATORIMPL_H_
00009 #define __BOXDECORATORIMPL_H_
00010 
00011 #include "StdAfx.h"
00012 #include "Gme.h"
00013 #include "resource.h"
00014 
00015 namespace DecoratorSDK {
00016 class DecoratorInterface;
00017 };
00018 
00019 //################################################################################################
00020 //
00021 // CLASS : CBoxDecoratorImpl
00022 //
00023 //################################################################################################
00024 
00025 class ATL_NO_VTABLE CBoxDecoratorImpl :
00026         public CComObjectRootEx<CComSingleThreadModel>,
00027         public IMgaElementDecorator,
00028         public CComCoClass<CBoxDecoratorImpl, &CLSID_BoxDecorator>
00029 {
00030 protected:
00031         DecoratorSDK::DecoratorInterface*       m_pElementDecorator;
00032         bool                                                            m_bLocationSet;
00033         bool                                                            m_bInitCallFromEx;
00034 
00035 public:
00036         CBoxDecoratorImpl();
00037         ~CBoxDecoratorImpl();
00038 
00039         DECLARE_REGISTRY_RESOURCEID( IDR_BOXDECORATOR )
00040         DECLARE_PROTECT_FINAL_CONSTRUCT()
00041 
00042         BEGIN_COM_MAP( CBoxDecoratorImpl )
00043                 COM_INTERFACE_ENTRY( IMgaElementDecorator )
00044                 COM_INTERFACE_ENTRY( IMgaDecoratorCommon )
00045                 COM_INTERFACE_ENTRY( IMgaDecorator )
00046         END_COM_MAP()
00047 
00048 public:
00049         // =============== inherited from IMgaDecorator
00050         STDMETHOD( Initialize )                                         ( /*[in]*/ IMgaProject* pProject, /*[in]*/ IMgaMetaPart* pPart, /*[in]*/ IMgaFCO* pFCO );
00051         STDMETHOD( Destroy )                                            ( void );
00052         STDMETHOD( GetMnemonic )                                        ( /*[out]*/ BSTR* bstrMnemonic );
00053         STDMETHOD( GetFeatures )                                        ( /*[out]*/ feature_code* pFeatureCodes );
00054         STDMETHOD( SetParam )                                           ( /*[in]*/ BSTR bstrName, /*[in]*/ VARIANT vValue );
00055         STDMETHOD( GetParam )                                           ( /*[in]*/ BSTR bstrName, /*[out]*/ VARIANT* pvValue );
00056         STDMETHOD( SetActive )                                          ( /*[in]*/ VARIANT_BOOL bIsActive );
00057         STDMETHOD( GetPreferredSize )                           ( /*[out]*/ LONG* plWidth, /*[out]*/ LONG* plHeight );
00058         STDMETHOD( SetLocation )                                        ( /*[in]*/ LONG sx, /*[in]*/ LONG sy, /*[in]*/ LONG ex, /*[in]*/ LONG ey );
00059         STDMETHOD( GetLocation )                                        ( /*[out]*/ LONG* sx, /*[out]*/ LONG* sy, /*[out]*/ LONG* ex, /*[out]*/ LONG* ey );
00060         STDMETHOD( GetLabelLocation )                           ( /*[out]*/ LONG* sx, /*[out]*/ LONG* sy, /*[out]*/ LONG* ex, /*[out]*/ LONG* ey );
00061         STDMETHOD( GetPortLocation )                            ( /*[in]*/ IMgaFCO* fco, /*[out]*/ LONG* sx, /*[out]*/ LONG* sy, /*[out]*/ LONG* ex, /*[out]*/ LONG* ey );
00062         STDMETHOD( GetPorts )                                           ( /*[out, retval]*/ IMgaFCOs** portFCOs );
00063         STDMETHOD( Draw )                                                       ( /*[in]*/ ULONG hdc );
00064         STDMETHOD( SaveState )                                          ( void );
00065 
00066         // =============== IMgaElementDecorator
00067         STDMETHOD( InitializeEx )                                       ( /*[in]*/ IMgaProject* pProject, /*[in]*/ IMgaMetaPart* pPart, /*[in]*/ IMgaFCO* pFCO, /*[in]*/ IMgaCommonDecoratorEvents* eventSink, /*[in]*/ ULONGLONG parentWnd );
00068         STDMETHOD( DrawEx )                                                     ( /*[in]*/ ULONG hdc, /*[in]*/ ULONGLONG gdipGraphics );
00069         STDMETHOD( SetSelected )                                        ( /*[in]*/ VARIANT_BOOL bIsSelected );
00070         STDMETHOD( MouseMoved )                                         ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00071         STDMETHOD( MouseLeftButtonDown )                        ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00072         STDMETHOD( MouseLeftButtonUp )                          ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00073         STDMETHOD( MouseLeftButtonDoubleClick )         ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00074         STDMETHOD( MouseRightButtonDown )                       ( /*[in]*/ ULONGLONG hCtxMenu, /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00075         STDMETHOD( MouseRightButtonUp )                         ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00076         STDMETHOD( MouseRightButtonDoubleClick )        ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00077         STDMETHOD( MouseMiddleButtonDown )                      ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00078         STDMETHOD( MouseMiddleButtonUp )                        ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00079         STDMETHOD( MouseMiddleButtonDoubleClick )       ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00080         STDMETHOD( MouseWheelTurned )                           ( /*[in]*/ ULONG nFlags, /*[in]*/ LONG distance, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00081         STDMETHOD( DragEnter )                                          ( /*[out]*/ ULONG* dropEffect, /*[in]*/ ULONGLONG pCOleDataObject, /*[in]*/ ULONG keyState, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00082         STDMETHOD( DragOver )                                           ( /*[out]*/ ULONG* dropEffect, /*[in]*/ ULONGLONG pCOleDataObject, /*[in]*/ ULONG keyState, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00083         STDMETHOD( Drop )                                                       ( /*[in]*/ ULONGLONG pCOleDataObject, /*[in]*/ ULONG dropEffect, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00084         STDMETHOD( DropFile )                                           ( /*[in]*/ ULONGLONG hDropInfo, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00085         STDMETHOD( MenuItemSelected )                           ( /*[in]*/ ULONG menuItemId, /*[in]*/ ULONG nFlags, /*[in]*/ LONG pointx, /*[in]*/ LONG pointy, /*[in]*/ ULONGLONG transformHDC );
00086         STDMETHOD( OperationCanceled )                          ( void );
00087 };
00088 
00089 #endif //__BOXDECORATORIMPL_H_