1 // Copyright (c) 2010 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.
5 #import <Cocoa/Cocoa.h>
7 #include "base/strings/string16.h"
9 namespace cocoa_l10n_util
{
11 // Compare function for -[NSArray sortedArrayUsingFunction:context:] that
12 // sorts the views in Y order bottom up. |context| is ignored.
13 NSInteger
CompareFrameY(id view1
, id view2
, void* context
);
15 // Helper for tweaking views. If view is a:
16 // checkbox, radio group or label: it gets a forced wrap at current size
17 // editable field: left as is
18 // anything else: do +[GTMUILocalizerAndLayoutTweaker sizeToFitView:]
19 NSSize
WrapOrSizeToFit(NSView
* view
);
21 // Walks views in top-down order, wraps each to their current width, and moves
22 // the latter ones down to prevent overlaps. Returns the vertical delta in view
24 CGFloat
VerticallyReflowGroup(NSArray
* views
);
26 // Like |base::ReplaceStringPlaceholders(const base::string16&,
27 // const base::string16&, size_t*)|, but for a NSString formatString.
28 NSString
* ReplaceNSStringPlaceholders(NSString
* formatString
,
29 const base::string16
& a
,
32 // Generates a tooltip string for a given URL and title.
33 NSString
* TooltipForURLAndTitle(NSString
* url
, NSString
* title
);
35 } // namespace cocoa_l10n_util