/* * MathPlanner 3.1 - Mathematical design tool. * Copyright(C) 2002 Jarmo Nikkanen * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation. * * You should have received a copy of the GNU General Public License with this program. * */ #ifndef _MATHPLANNER_FRAME_H #define _MATHPLANNER_FRAME_H #include #include #include #include #include "Extern.h" class DataStorage; class Paper; class ApplicationControl; class MathWindow; #define PAPER_OBJECT_FUNCTION 0 #define PAPER_OBJECT_GRAPH 1 #define PAPER_OBJECT_TEXT 2 #define PAPER_OBJECT_IMAGE 3 #define PAPER_OBJECT_QPICTURE 4 class MathFrame : public QObject { public: MathFrame(int Type,QRect bounds,class ApplicationControl *,class Paper *,int ascent=0); MathFrame(DataStorage *,class ApplicationControl *,class Paper *); virtual ~MathFrame(); virtual void SetColor(QColor); virtual void Draw(QPainter *); virtual void SetBounds(QRect,int ascent=0); virtual void Selected(); // Single klick virtual void Activate(); // Double klick virtual void DeActivate(); bool IsActive(); int Type(); QRect Bounds(bool old=false); void ResetBounds(); int Ascent(); QPoint Position(); MathWindow * MainWindow(); bool IsInResizeArea(QPoint p); bool IsInBounds(QPoint p); virtual bool IsEmpty(); void Enable(bool,bool,bool); virtual void CalculateBounds(); virtual void MousePressed(QPoint p); bool HasFocus(); void UnFocus(); void SetFocus(); virtual DataStorage *BuildStorage(); virtual void MoveTo(QPoint); virtual void MessageReceived(DataStorage *msg,int rec); virtual void PostMessage(DataStorage *msg,int dest=TO_FRAME); bool frame_enabled; bool resize_enabled; bool empty; bool always; bool active; bool multi; int ObjectType; QRect bounds; QRect old_bounds; int ascent; QRect resizerect; QRect view; QColor color; class ApplicationControl *AppControl; class Paper *paper; }; #endif