OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 #ifndef IOS_CHROME_BROWSER_UI_FANCY_UI_BIDI_CONTAINER_VIEW_H_ |
| 5 #define IOS_CHROME_BROWSER_UI_FANCY_UI_BIDI_CONTAINER_VIEW_H_ |
| 6 |
| 7 #import <UIKit/UIKit.h> |
| 8 |
| 9 #include "base/mac/scoped_nsobject.h" |
| 10 |
| 11 namespace ios { |
| 12 namespace rtl { |
| 13 enum AdjustSubviewsForRTLType { |
| 14 ADJUST_FRAME_AND_AUTOROTATION_MASK_FOR_ALL_SUBVIEWS, |
| 15 ADJUST_FRAME_FOR_UPDATED_SUBVIEWS |
| 16 }; |
| 17 } // namespace rtl |
| 18 } // namespace ios |
| 19 |
| 20 // A UIView that lays outs its subviews based on the direction of the current |
| 21 // language. If the current language is RTL then during the first call to |
| 22 // |layoutSubviews|, this view will flip horizontally all its subviews around |
| 23 // its center axis and adjust the autoresizing masks. |
| 24 @interface BidiContainerView : UIView { |
| 25 @private |
| 26 ios::rtl::AdjustSubviewsForRTLType adjustSubviewsType_; |
| 27 base::scoped_nsobject<NSMutableSet> subviewsToBeAdjustedForRTL_; |
| 28 } |
| 29 |
| 30 // Adds |subview| to the set of subviews that need to be adjusted to RTL. If the |
| 31 // current language is RTL, then the next call |layoutSubviews| will flip |
| 32 // |subview| horizontally around its center axis. |
| 33 - (void)setSubviewNeedsAdjustmentForRTL:(UIView*)subview; |
| 34 |
| 35 @end |
| 36 |
| 37 #endif // IOS_CHROME_BROWSER_UI_FANCY_UI_BIDI_CONTAINER_VIEW_H_ |
OLD | NEW |