Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #pragma once
00017
00018 #include "maxheap.h"
00019 #include "maxtypes.h"
00020 #include "bitmap.h"
00021
00022
00023 class DADMgr;
00024 class CropCallback;
00025
00026 #ifdef IMAGE_VIEW_EXPORTS
00027 #define IMAGE_VIEW_API __declspec(dllexport)
00028 #else
00029 #define IMAGE_VIEW_API __declspec(dllimport)
00030 #endif
00031
00032
00033
00034
00035
00036
00037
00038 #define WM_BV_TOOLBAR_RIGHTCLICK WM_USER + 0x8ac4
00039
00040 #define MAX_BITMAP_VIEWER_CLASS _M("MaxBitmapViewerClass") // windows class name
00041
00042
00043
00044
00045
00046
00047 class BaseInterface;
00048
00049
00055 class IMAGE_VIEW_API IImageViewer: public MaxHeapOperators
00056 {
00057 public:
00058 enum DisplayStyle { IV_FLOATING = 0, IV_DOCKED };
00059
00060 enum WindowPosition
00061 {
00062 WPos_NULL = 0,
00063 WPos_UpperLeft,
00064 WPos_LowerLeft,
00065 WPos_UpperRight,
00066 WPos_LowerRight,
00067 WPos_Center,
00068
00069
00070 WPos_Renderer = 10,
00071 WPos_VideoPostPrimary,
00072 WPos_VideoPostSecondary,
00073 };
00074
00075
00076
00077
00078 #pragma warning(push)
00079 #pragma warning(disable:4100)
00080 class PostDisplayCallback : public MaxHeapOperators
00081 {
00082 public:
00089 virtual void PostDisplayCB(HWND hWnd) = 0;
00090
00091
00100 virtual BaseInterface* GetInterface (Interface_ID id) { return NULL; }
00101 };
00102
00103
00104
00105
00106
00107 class PreEventHandlerCallback : public MaxHeapOperators
00108 {
00109 public:
00123 virtual LRESULT EventHandlerCB(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool &propagate) = 0;
00124
00125
00132 virtual BaseInterface* GetInterface (Interface_ID id) { return NULL; }
00133 };
00134 #pragma warning(pop)
00135
00140 virtual void Show() = 0;
00145 virtual void Hide() = 0;
00146
00147
00150 virtual HWND GetHDisplayWindow() = 0;
00151
00152
00160 virtual void SetPos(int x, int y, int w, int h) = 0;
00161
00162
00165 virtual DisplayStyle GetDisplayStyle() const = 0;
00166
00167
00173 virtual void SetContextHelpId(DWORD helpID) = 0;
00175 virtual DWORD GetContextHelpId() const = 0;
00176
00177
00183 virtual void SetDADMgr(DADMgr *pDADMgr) = 0;
00184 virtual DADMgr *GetDADMgr() const = 0;
00185
00186
00192 virtual void SetPreEventHandlerCallback(PreEventHandlerCallback* pPreEventHandlerCB) = 0;
00195 virtual PreEventHandlerCallback* GetPreEventHandlerCallback() const = 0;
00196
00197
00203 virtual void SetPostDisplayCallback(PostDisplayCallback* pPostDisplayCB) = 0;
00206 virtual PostDisplayCallback* GetPostDisplayCallback() const = 0;
00207
00208
00216 virtual BaseInterface* GetInterface (Interface_ID id) { UNUSED_PARAM(id); return NULL; }
00217 };
00218
00219
00220
00221
00222
00231 class IMAGE_VIEW_API IMaxBitmapViewer : public IImageViewer
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242 {
00243 public:
00244
00251 virtual void SetBitmap(Bitmap* pBitmap) = 0;
00254 virtual Bitmap* GetBitmap() const = 0;
00255
00256
00265 virtual void SetCropCB(CropCallback* pCropCallback) = 0;
00268 virtual CropCallback* GetCropCB() const = 0;
00269
00270
00280 virtual void SetAutonomous(bool isAutonomous) = 0;
00285 virtual bool GetAutonomous() const = 0;
00286
00287
00291 virtual void SetCurrentPosition(WindowPosition currentPosition) = 0;
00294 virtual WindowPosition GetCurrentPosition() const = 0;
00295
00296
00303 virtual void SetShowSaveButton(bool showSaveButton) = 0;
00306 virtual bool GetShowSaveButton() const = 0;
00307
00308
00328 virtual bool Display(MCHAR *title, WindowPosition position = WPos_Center) = 0;
00329
00350 virtual bool Display(MCHAR *title, HWND hParent, int x, int y, int w, int h) = 0;
00354 virtual bool UnDisplay() = 0;
00359 virtual void ClearScreen() = 0;
00360
00361
00368 virtual POINT XFormScreenToBitmap(const POINT &pt) const = 0;
00375 virtual POINT XFormBitmapToScreen(const POINT &pt) const = 0;
00382 virtual Rect XFormScreenToBitmap(const Rect &rect) const = 0;
00389 virtual Rect XFormBitmapToScreen(const Rect &rect) const = 0;
00390
00391
00397 virtual void ShowToolbar(bool show) = 0;
00400 virtual void ToggleToolbar() = 0;
00401
00402
00410 virtual void GetDrawableRect(Rect& drawableRect) = 0;
00411
00412
00418 virtual void RefreshWindow(Rect* pRefreshRegion = NULL) = 0;
00419
00420
00428 virtual BaseInterface* GetInterface (Interface_ID id) { UNUSED_PARAM(id); return NULL; }
00429 };
00430
00431
00442 IMAGE_VIEW_API IMaxBitmapViewer* CreateIMaxBitmapViewer(Bitmap* pBitmap, IImageViewer::DisplayStyle displayStyle);
00449 IMAGE_VIEW_API void ReleaseIMaxBitmapViewer(IMaxBitmapViewer *);
00450