00001
00002
00003
00004
00005
00006
00007 #ifndef BACKGROUND_STATE_CONTEXT_H
00008 #define BACKGROUND_STATE_CONTEXT_H
00009
00010 #include "BackgroundImage.h"
00011 #include "BackgroundStateAbstractBase.h"
00012 #include <QVector>
00013
00014 class DocumentModelColorFilter;
00015 class DocumentModelGridRemoval;
00016 class GraphicsView;
00017 class MainWindow;
00018 class QGraphicsPixmapItem;
00019 class Transformation;
00020
00032 class BackgroundStateContext
00033 {
00034 public:
00036 BackgroundStateContext(MainWindow &mainWindow);
00037
00039 void close();
00040
00042 void fitInView (GraphicsView &view);
00043
00045 QImage imageForCurveState () const;
00046
00048 void requestStateTransition (BackgroundState backgroundState);
00049
00051 void setBackgroundImage (BackgroundImage backgroundImage);
00052
00055 void setCurveSelected (const Transformation &transformation,
00056 const DocumentModelGridRemoval &modelGridRemoval,
00057 const DocumentModelColorFilter &modelColorFilter,
00058 const QString &curveSelected);
00059
00061 void setPixmap (const Transformation &transformation,
00062 const DocumentModelGridRemoval &modelGridRemoval,
00063 const DocumentModelColorFilter &modelColorFilter,
00064 const QPixmap &pixmapOriginal,
00065 const QString &curveSelected);
00066
00068 void updateColorFilter (const Transformation &transformation,
00069 const DocumentModelGridRemoval &modelGridRemoval,
00070 const DocumentModelColorFilter &colorFilter,
00071 const QString &curveSelected);
00072
00073 private:
00074 BackgroundStateContext();
00075
00076 void completeRequestedStateTransitionIfExists ();
00077
00078 const MainWindow &m_mainWindow;
00079
00080 QVector<BackgroundStateAbstractBase*> m_states;
00081 BackgroundState m_currentState;
00082 BackgroundState m_requestedState;
00083 };
00084
00085 #endif // BACKGROUND_STATE_CONTEXT_H