summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreviewView.h
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2015-10-06 19:52:42 +0200
committerDamiano Galassi <[email protected]>2015-10-06 19:52:42 +0200
commitb4a0e952b323ce54616f5c1610454195b7b2445a (patch)
treee0c33961ff2b12f40f2a577a7f9b6ca9374ad1eb /macosx/HBPreviewView.h
parentde4e62133b9607101db3386bce78c0030ce6f883 (diff)
MacGui: move some code out of HBPreviewController.m. Remember the windows size when going back from the Scale To Screen mode
Diffstat (limited to 'macosx/HBPreviewView.h')
-rw-r--r--macosx/HBPreviewView.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/macosx/HBPreviewView.h b/macosx/HBPreviewView.h
new file mode 100644
index 000000000..b590b7e8d
--- /dev/null
+++ b/macosx/HBPreviewView.h
@@ -0,0 +1,51 @@
+/* HBPreviewView.h
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+#import <Cocoa/Cocoa.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ * A HBPreviewView is a sublcass of NSView that can be used to display an image
+ * plus a border.
+ */
+@interface HBPreviewView : NSView
+
+/**
+ * The image displayed by the view.
+ */
+@property (nonatomic, readwrite, nullable) CGImageRef image;
+
+/**
+ * The scale at which the image is shown.
+ */
+@property (nonatomic, readonly) CGFloat scale;
+
+/**
+ * The actual frame of the displayed image.
+ */
+@property (nonatomic, readonly) CGRect pictureFrame;
+
+/**
+ * Wheters the image will be scaled to fill the view
+ * or not.
+ */
+@property (nonatomic, readwrite) BOOL fitToView;
+
+/**
+ * If enabled, the view will show a white border around the image.
+ */
+@property (nonatomic, readwrite) BOOL showBorder;
+
+/**
+ * Given the size of the preview image to be shown, returns the best possible
+ * size for the view.
+ */
+- (NSSize)optimalViewSizeForImageSize:(NSSize)imageSize minSize:(NSSize)minSize;
+
+@end
+
+NS_ASSUME_NONNULL_END