summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreviewView.h
diff options
context:
space:
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