1 /* 2 * Copyright 2003-2010, Haiku, Inc. All Rights Reserved. 3 * Copyright 2004-2005 yellowTAB GmbH. All Rights Reserverd. 4 * Copyright 2006 Bernd Korz. All Rights Reserved 5 * Distributed under the terms of the MIT License. 6 * 7 * Authors: 8 * Fernando Francisco de Oliveira 9 * Michael Wilber 10 * Michael Pfeiffer 11 * yellowTAB GmbH 12 * Bernd Korz 13 * Stephan Aßmus <superstippi@gmx.de> 14 */ 15 #ifndef IMAGE_FILE_NAVIGATOR_H 16 #define IMAGE_FILE_NAVIGATOR_H 17 18 19 #include <Entry.h> 20 #include <Messenger.h> 21 #include <String.h> 22 23 24 class Navigator; 25 26 27 class ImageFileNavigator { 28 public: 29 ImageFileNavigator(const entry_ref& ref, 30 const BMessenger& trackerMessenger); 31 virtual ~ImageFileNavigator(); 32 33 void SetTo(const entry_ref& ref, int32 page = 1, 34 int32 pageCount = 1); 35 const entry_ref& CurrentRef() const { return fCurrentRef; } 36 37 // The same image file may have multiple pages, TIFF images for 38 // example. The page count is determined at image loading time. 39 int32 CurrentPage(); 40 int32 PageCount(); 41 42 bool FirstPage(); 43 bool LastPage(); 44 bool NextPage(); 45 bool PreviousPage(); 46 bool GoToPage(int32 page); 47 48 bool FirstFile(); 49 bool NextFile(); 50 bool PreviousFile(); 51 bool HasNextFile(); 52 bool HasPreviousFile(); 53 54 bool GetNextFile(const entry_ref& ref, 55 entry_ref& nextRef); 56 bool GetPreviousFile(const entry_ref& ref, 57 entry_ref& previousRef); 58 59 bool MoveFileToTrash(); 60 61 private: 62 Navigator* fNavigator; 63 64 entry_ref fCurrentRef; 65 int32 fDocumentIndex; 66 // of the image in the file 67 int32 fDocumentCount; 68 // number of images in the file 69 70 BString fImageType; 71 // Type of image, for use in status bar and caption 72 BString fImageMime; 73 }; 74 75 76 #endif // IMAGE_FILE_NAVIGATOR_H 77