#pragma once 
 | 
#include "kcontrol.hpp" 
 | 
  
 | 
namespace Hxsoft {    namespace XFrame {namespace XOffice {namespace XFlowChart{ 
 | 
  
 | 
    //this interface all index param start by one 
 | 
    typedef int XFODrawState; 
 | 
    #define XFOSELECTION 0x0000 
 | 
    #define XFOLINK         0x0001 
 | 
    #define XFOWORKNODE     0x0002 
 | 
  
 | 
    typedef int XFOState; 
 | 
    #define XFONORMAL    0x0000 
 | 
    #define XFOSELECTED 0x0001 
 | 
    #define XFOMOVING    0x0002 
 | 
    #define XFORESIZING    0x0004 
 | 
    #define XFOLINKING    0x0008 
 | 
    #define XFOCREATING    0x0010 
 | 
    #define XFOWORKNODING    0x0020 
 | 
    #define XFOREADONLY    0x1000 
 | 
    #define XFORUNSTATE 0x8000 
 | 
  
 | 
    typedef int XFOHitPosition; 
 | 
    #define XFOHITNONE        0x0000 
 | 
    #define XFOHITLEFTTOP        0x0001     
 | 
    #define XFOHITRIGHTTOP        0x0002     
 | 
    #define XFOHITRIGHTBOTTOM    0x0004     
 | 
    #define XFOHITLEFTBOTTOM    0x0008     
 | 
  
 | 
    #define XFOHITTOPCENTER        0x0010     
 | 
    #define XFOHITRIGHTCENTER    0x0020     
 | 
    #define XFOHITBOTTOMCENTER    0x0040     
 | 
    #define XFOHITLEFTCENTER    0x0080 
 | 
  
 | 
    class  XFlowChartObject 
 | 
    { 
 | 
    public: 
 | 
        typedef int XFlowChartObjectStatus; 
 | 
    public: 
 | 
        int LoadObject(KXMLDOMElement  pElement); 
 | 
        int LoadObjectXml(LPTSTR pStrXml); 
 | 
    public: 
 | 
        void SetFRect(RECT rect); 
 | 
    public: 
 | 
        XFOHitPosition GetHitResizePat(POINT pt); 
 | 
    public: 
 | 
        void InvalidatePatRgn(HWND hWnd, POINT& ptOffset); 
 | 
        void HitAdjust(XFOHitPosition htpos, int cx, int cy); 
 | 
    public: 
 | 
        int TestHotHited(POINT pt, RECT& rc); 
 | 
        int DrawHoted(HDC hPaintDC, int nIndex); 
 | 
    public: 
 | 
        LPTSTR GetCaption(); 
 | 
        KXMLDOMElement GetElement(); 
 | 
        LPTSTR GetShapeType(); 
 | 
        RECT& GetRect(); 
 | 
    public: 
 | 
        bool SetUrl(LPTSTR pUrl); 
 | 
        bool SetCaption(LPTSTR pCaption); 
 | 
        LPTSTR GetUrl(); 
 | 
        LPTSTR GetGuid(); 
 | 
    }; 
 | 
  
 | 
    #define FXOLineStyle int 
 | 
    #define FXOLINENORMAL 0x0000 
 | 
    #define FXOLINEDIRECT 0x0001 
 | 
    #define FXOLINECURVE  0x0002 
 | 
    #define FXOLINEOWNER  0x0100 
 | 
  
 | 
    class XFlowChartLink 
 | 
    { 
 | 
    public: 
 | 
        int DrawHoted(HDC hPaintDC, int nIndex); 
 | 
    public: 
 | 
        //int AutoCalcPoints(const vector<RECT>* rects = NULL); 
 | 
        //int AutoCalcPoints(POINT ptStart, int paStart, POINT ptEnd, int paEnd, FXOLineStyle dwLineStyle, const vector<RECT>* rects, vector<POINT>* pts); 
 | 
    public: 
 | 
        //int LoadObject(vector<class XFlowChartObject*>& DrawObjects, KXMLDOMElement  pElement); 
 | 
        bool IsHoted(int x, int y); 
 | 
    public: 
 | 
        XFlowChartObject* GetStartObject(); 
 | 
        XFlowChartObject* GetEndObject(); 
 | 
    }; 
 | 
  
 | 
    class  IFlowChart :public IXFControl 
 | 
    { 
 | 
    public: 
 | 
        XFlowChartObject* GetSelectedObject(); 
 | 
        bool SelectedObject(XFlowChartObject* pObject); 
 | 
    public: 
 | 
        int GetObjectCount(); 
 | 
        XFlowChartObject* GetObjectByIndex(int nIndex); 
 | 
  
 | 
        int GetLinkCount(); 
 | 
        XFlowChartLink* GetLinkbyIndex(int nIndex); 
 | 
    public: 
 | 
        bool RemoveObject(XFlowChartObject* pObject, bool bDeletedLink = true); 
 | 
        XFlowChartObject* AddObject(LPTSTR pShapeType, LPTSTR pCaption, LPTSTR pUrl = NULL, RECT* pRect = NULL); 
 | 
    public: 
 | 
        bool SetobjectUrl(XFlowChartObject* pObject, LPTSTR pUrl); 
 | 
        bool SetobjectCaption(XFlowChartObject* pObject, LPTSTR pCaption); 
 | 
    public: 
 | 
        XFlowChartLink* AddLink(XFlowChartObject* pFrom, XFlowChartObject* pTo, bool bDoubleArrow = true); 
 | 
    public: 
 | 
        XFlowChartObject* GetObjectAt(POINT pt); 
 | 
    public: 
 | 
        int Save(KXMLDOMElement pElement); 
 | 
        int Load(KXMLDOMElement pElement); 
 | 
    }; 
 | 
}}}} 
 |