/** * Copyright Mikael Högdahl - triyana@users.sourceforge.net * * This source is distributed under the terms of the Q Public License version 1.0, * created by Trolltech (www.trolltech.com). */ #ifndef MHDC_h #define MHDC_h #include "MHPrice.h" #include "MHVector.h" /** * Inherit from this object to implement REAL device context functions. Either for * a gui toolkit or an image of some kind. */ class MHDC : public MH { public: enum COLORS { BLUE = 0, RED, GREEN, MAGENTA, YELLOW, CYAN, GRAY, BLACK, WHITE, END_COLORS, }; MHDC (); virtual ~MHDC (); virtual void BeginClip () {;} const char* Class () {return "MHDC";} virtual void Color (int color) = 0; virtual void DrawLine (int x1, int y1, int x2, int y2) = 0; virtual void DrawRect (int x1, int y1, int x2, int y2) = 0; virtual void DrawText (const char* p, int x, int y, bool center = false) = 0; virtual void EndClip () {;} virtual int GetCharHeight() = 0; int GetFontSize () {return aFontSize;} virtual int GetHeight () = 0; virtual int GetStringWidth (const char* pString) = 0; virtual int GetWidth () = 0; virtual bool QueryLeft (int x, int y, MHPrice* p) {return false;} virtual bool QueryRight (int x, int y, MHPrice* p) {return false;} virtual void SetBrushColor (int Color) = 0; void SetFontSize (int size) {aFontSize = size;} virtual void SetPenColor (int Color) = 0; protected: int aFontSize; }; #endif