Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: ios/chrome/browser/ui/util/manual_text_framer.h

Issue 2580333003: Upstream Chrome on iOS source code [10/11]. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ios/chrome/browser/ui/util/manual_text_framer.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/util/manual_text_framer.h
diff --git a/ios/chrome/browser/ui/util/manual_text_framer.h b/ios/chrome/browser/ui/util/manual_text_framer.h
new file mode 100644
index 0000000000000000000000000000000000000000..006a40f011a563493d07b388c6bc1e62fc423c13
--- /dev/null
+++ b/ios/chrome/browser/ui/util/manual_text_framer.h
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_UTIL_MANUAL_TEXT_FRAMER_H_
+#define IOS_CHROME_BROWSER_UI_UTIL_MANUAL_TEXT_FRAMER_H_
+
+#import <CoreText/CoreText.h>
+#import <Foundation/Foundation.h>
+
+@protocol TextFrame;
+
+// Object encapsulating the manual framing of an attributed string within a
+// bounding rect.
+// Known limitations:
+// - Justified-aligned text is not supported.
+// - Hyphenation is never attempted, regardless of NSParagraphStyle's
+// |hyphenationFactor|.
+@interface ManualTextFramer : NSObject
+
+// Creates an instance that frames |string| within |bounds|.
+- (instancetype)initWithString:(NSAttributedString*)string
+ inBounds:(CGRect)bounds NS_DESIGNATED_INITIALIZER;
+- (instancetype)init NS_UNAVAILABLE;
+
+// Manually Frames the paragraph within the bounds provided upon initialization.
+// Calling this method populates |textFrame|.
+- (void)frameText;
+
+// The TextFrame created by |-frameText|. Will be nil before |-frameText| is
+// called.
+@property(nonatomic, readonly) id<TextFrame> textFrame;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_UTIL_MANUAL_TEXT_FRAMER_H_
« no previous file with comments | « no previous file | ios/chrome/browser/ui/util/manual_text_framer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698