2 * Copyright 2003-2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Fernando Francisco de Oliveira
10 #ifndef SHOW_IMAGE_WINDOW_H
11 #define SHOW_IMAGE_WINDOW_H
17 #include "ImageFileNavigator.h"
18 #include "PrintOptionsWindow.h"
30 class ShowImageStatusView
;
33 // public message constants
35 MSG_MODIFIED
= 'mMOD',
36 MSG_UPDATE_STATUS
= 'mUPS',
37 MSG_UPDATE_STATUS_TEXT
= 'mUPT',
38 MSG_UPDATE_STATUS_ZOOM
= 'mUPZ',
39 MSG_SELECTION
= 'mSEL',
40 MSG_FILE_NEXT
= 'mFLN',
41 MSG_FILE_PREV
= 'mFLP',
42 kMsgDeleteCurrentFile
= 'mDcF',
43 MSG_SLIDE_SHOW
= 'mSSW',
44 kMsgStopSlideShow
= 'msss',
45 MSG_FULL_SCREEN
= 'mFSC',
46 kShowToolBarIfEnabled
= 'mSTE',
47 MSG_EXIT_FULL_SCREEN
= 'mEFS',
48 MSG_WINDOW_HAS_QUIT
= 'wndq'
52 class ShowImageWindow
: public BWindow
{
54 ShowImageWindow(BRect frame
,
56 const BMessenger
& trackerMessenger
);
57 virtual ~ShowImageWindow();
59 void BuildContextMenu(BMenu
* menu
);
62 virtual void Zoom(BPoint origin
, float width
, float height
);
63 virtual void MessageReceived(BMessage
* message
);
64 virtual bool QuitRequested();
67 void _AddMenus(BMenuBar
* bar
);
68 void _ResizeWindowToImage();
69 void _BuildViewMenu(BMenu
* menu
, bool popupMenu
);
70 BMenu
* _BuildRatingMenu();
71 BMenuItem
* _AddItemMenu(BMenu
* menu
, const char* label
,
72 uint32 what
, char shortcut
, uint32 modifier
,
73 const BHandler
* target
,
75 BMenuItem
* _AddDelayItem(BMenu
* menu
, const char* label
,
78 bool _ToggleMenuItem(uint32 what
);
79 void _EnableMenuItem(BMenu
* menu
, uint32 what
,
81 void _MarkMenuItem(BMenu
* menu
, uint32 what
,
83 void _MarkSlideShowDelay(bigtime_t delay
);
85 void _UpdateStatusText(const BMessage
* message
);
86 void _LoadError(const entry_ref
& ref
);
87 void _SaveAs(BMessage
* message
);
88 // Handle Save As submenu choice
89 void _SaveToFile(BMessage
* message
);
90 // Handle save file panel message
92 status_t
_LoadImage(bool forward
= true);
93 bool _PreloadImage(bool forward
, entry_ref
& ref
);
94 void _ToggleFullScreen();
95 void _ApplySettings();
96 void _SavePrintOptions();
98 void _PrepareForPrint();
99 void _Print(BMessage
* msg
);
101 void _SetSlideShowDelay(bigtime_t delay
);
102 void _StartSlideShow();
103 void _StopSlideShow();
105 void _UpdateRatingMenu();
107 void _GetFileInfo(const entry_ref
& ref
);
109 void _SetToolBarVisible(bool visible
,
110 bool animate
= false);
111 void _SetToolBarBorder(bool visible
);
113 void _SaveWidthAndHeight();
116 ImageFileNavigator fNavigator
;
117 BFilePanel
* fSavePanel
;
120 BMenu
* fGoToPageMenu
;
121 BMenu
* fSlideShowDelayMenu
;
124 bool fToolBarVisible
;
125 BScrollView
* fScrollView
;
126 ShowImageView
* fImageView
;
127 ShowImageStatusView
* fStatusView
;
128 ProgressWindow
* fProgressWindow
;
134 BMessage
* fPrintSettings
;
135 PrintOptions fPrintOptions
;
139 BMessageRunner
* fSlideShowRunner
;
140 bigtime_t fSlideShowDelay
;
144 #endif // SHOW_IMAGE_WINDOW_H