Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/iphone
diff options
context:
space:
mode:
authorKirill Zhdanovich <kzhdanovich@gmail.com>2013-06-21 14:25:53 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:57:15 +0300
commit33fdd919358dfa53955b08421e7c91d5d17ffbd2 (patch)
tree12aa4bbdb2a23b1764fabe39a8db86a08462d471 /iphone
parenta452b0829d604a5e00a15f3d47466d4ecdee9965 (diff)
[iOS] New Interface + new balloon
Diffstat (limited to 'iphone')
-rw-r--r--iphone/Maps/Bookmarks/AddSetVC.h7
-rw-r--r--iphone/Maps/Bookmarks/AddSetVC.mm28
-rw-r--r--iphone/Maps/Bookmarks/BookmarksRootVC.h8
-rw-r--r--iphone/Maps/Bookmarks/BookmarksRootVC.mm3
-rw-r--r--iphone/Maps/Bookmarks/BookmarksVC.h2
-rw-r--r--iphone/Maps/Bookmarks/BookmarksVC.mm1
-rw-r--r--iphone/Maps/Bookmarks/PlacePageVC.h21
-rw-r--r--iphone/Maps/Bookmarks/PlacePageVC.mm833
-rw-r--r--iphone/Maps/Bookmarks/SelectSetVC.h8
-rw-r--r--iphone/Maps/Bookmarks/SelectSetVC.mm15
-rw-r--r--iphone/Maps/Classes/MapViewController.h9
-rw-r--r--iphone/Maps/Classes/MapViewController.mm166
-rw-r--r--iphone/Maps/Classes/MapsAppDelegate.h2
-rw-r--r--iphone/Maps/Classes/MapsAppDelegate.mm13
-rw-r--r--iphone/Maps/Classes/SearchVC.h4
15 files changed, 606 insertions, 514 deletions
diff --git a/iphone/Maps/Bookmarks/AddSetVC.h b/iphone/Maps/Bookmarks/AddSetVC.h
index 402d4e60c6..77a65fbfef 100644
--- a/iphone/Maps/Bookmarks/AddSetVC.h
+++ b/iphone/Maps/Bookmarks/AddSetVC.h
@@ -1,13 +1,10 @@
#import <UIKit/UIKit.h>
-@class BalloonView;
-
@interface AddSetVC : UITableViewController <UITextFieldDelegate>
{
- // @TODO store as a property to retain reference
- BalloonView * m_balloon;
+ size_t * m_index;
}
-- (id) initWithBalloonView:(BalloonView *)view;
+- (id) initWithIndex:(size_t *)index;
@end
diff --git a/iphone/Maps/Bookmarks/AddSetVC.mm b/iphone/Maps/Bookmarks/AddSetVC.mm
index fd04dfe609..9b4d793cd3 100644
--- a/iphone/Maps/Bookmarks/AddSetVC.mm
+++ b/iphone/Maps/Bookmarks/AddSetVC.mm
@@ -1,21 +1,19 @@
#import "AddSetVC.h"
-#import "BalloonView.h"
#import "Framework.h"
#define TEXT_FIELD_TAG 666
@implementation AddSetVC
-- (id) initWithBalloonView:(BalloonView *)view
+- (id) initWithIndex:(size_t *)index;
{
self = [super initWithStyle:UITableViewStyleGrouped];
if (self)
{
- m_balloon = view;
-
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(onSaveClicked)] autorelease];
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancelClicked)] autorelease];
self.title = NSLocalizedString(@"add_new_set", @"Add New Bookmark Set dialog title");
+ m_index = index;
}
return self;
}
@@ -31,20 +29,14 @@
NSString * text = textField.text;
if (text.length)
{
- m_balloon.setName = text;
- [m_balloon deleteBookmark];
-
- Framework & f = GetFramework();
- size_t const pos = f.AddCategory([text UTF8String]);
- [m_balloon addBookmarkToCategory:pos];
-
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
- [self.navigationController popToRootViewControllerAnimated:YES];
- else
- {
- UIViewController * t = [self.navigationController.viewControllers objectAtIndex:1];
- [self.navigationController popToViewController:t animated:YES];
- }
+ *m_index = GetFramework().AddCategory([text UTF8String]);
+ NSArray * arr = self.navigationController.viewControllers;
+ for (UIViewController * v in arr)
+ if ([v isMemberOfClass:NSClassFromString(@"PlacePageVC")])
+ {
+ [self.navigationController popToViewController:v animated:YES];
+ break;
+ }
}
}
diff --git a/iphone/Maps/Bookmarks/BookmarksRootVC.h b/iphone/Maps/Bookmarks/BookmarksRootVC.h
index 2ca61a9cce..92a2ee84dd 100644
--- a/iphone/Maps/Bookmarks/BookmarksRootVC.h
+++ b/iphone/Maps/Bookmarks/BookmarksRootVC.h
@@ -1,13 +1,7 @@
#import <UIKit/UIKit.h>
-@class BalloonView;
-
@interface BookmarksRootVC : UITableViewController <UITextFieldDelegate>
-{
- // @TODO store as a property to retain reference
- BalloonView * m_balloon;
-}
-- (id) initWithBalloonView:(BalloonView *)view;
+- (id) init;
@end
diff --git a/iphone/Maps/Bookmarks/BookmarksRootVC.mm b/iphone/Maps/Bookmarks/BookmarksRootVC.mm
index 66e86b1ac4..0c955fac12 100644
--- a/iphone/Maps/Bookmarks/BookmarksRootVC.mm
+++ b/iphone/Maps/Bookmarks/BookmarksRootVC.mm
@@ -12,12 +12,11 @@
@implementation BookmarksRootVC
-- (id) initWithBalloonView:(BalloonView *)view
+- (id) init
{
self = [super initWithStyle:UITableViewStyleGrouped];
if (self)
{
- m_balloon = view;
self.title = NSLocalizedString(@"bookmarks", @"Boormarks - dialog title");
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]
diff --git a/iphone/Maps/Bookmarks/BookmarksVC.h b/iphone/Maps/Bookmarks/BookmarksVC.h
index 86d606eb8b..0ba157cf71 100644
--- a/iphone/Maps/Bookmarks/BookmarksVC.h
+++ b/iphone/Maps/Bookmarks/BookmarksVC.h
@@ -2,8 +2,6 @@
#import <MessageUI/MFMailComposeViewController.h>
#import "LocationManager.h"
-@class BalloonView;
-
@interface BookmarksVC : UITableViewController <LocationObserver, UITextFieldDelegate, MFMailComposeViewControllerDelegate>
{
LocationManager * m_locationManager;
diff --git a/iphone/Maps/Bookmarks/BookmarksVC.mm b/iphone/Maps/Bookmarks/BookmarksVC.mm
index 2188060e5b..765f3dd3ef 100644
--- a/iphone/Maps/Bookmarks/BookmarksVC.mm
+++ b/iphone/Maps/Bookmarks/BookmarksVC.mm
@@ -1,6 +1,5 @@
#import "BookmarksVC.h"
#import "CustomNavigationView.h"
-#import "BalloonView.h"
#import "MapsAppDelegate.h"
#import "CompassView.h"
#import "BookmarkCell.h"
diff --git a/iphone/Maps/Bookmarks/PlacePageVC.h b/iphone/Maps/Bookmarks/PlacePageVC.h
index b0e05912ba..2417807c90 100644
--- a/iphone/Maps/Bookmarks/PlacePageVC.h
+++ b/iphone/Maps/Bookmarks/PlacePageVC.h
@@ -1,21 +1,16 @@
#import <UIKit/UIKit.h>
#import <MessageUI/MFMessageComposeViewController.h>
#import <MessageUI/MFMailComposeViewController.h>
+#import "../../../map/bookmark.hpp"
-@class BalloonView;
-@interface PlacePageVC : UITableViewController <UITextFieldDelegate, UIActionSheetDelegate, MFMailComposeViewControllerDelegate, MFMessageComposeViewControllerDelegate, UIPickerViewDelegate>
-{
- BOOL m_hideNavBar;
- // @TODO store as a property to retain reference
- BalloonView * m_balloon;
- // If YES, pin should be removed when closing this dialog
- BOOL m_removePinOnClose;
- int selectedRow;
-}
+namespace search { struct AddressInfo; }
+namespace url_scheme { struct ApiPoint; }
-@property (nonatomic, retain) NSArray * pinsArray;
-
-- (id) initWithBalloonView:(BalloonView *)view;
+@interface PlacePageVC : UITableViewController <UITextFieldDelegate, UIActionSheetDelegate, MFMailComposeViewControllerDelegate, MFMessageComposeViewControllerDelegate, UIPickerViewDelegate, UITextViewDelegate>
+- (id) initWithInfo:(search::AddressInfo const &)info point:(CGPoint)point;
+- (id) initWithApiPoint:(url_scheme::ApiPoint const &)apiPoint;
+- (id) initWithBookmark:(BookmarkAndCategory)bmAndCat;
+- (id) initWithName:(NSString *)name andGlobalPoint:(CGPoint)point;
@end
diff --git a/iphone/Maps/Bookmarks/PlacePageVC.mm b/iphone/Maps/Bookmarks/PlacePageVC.mm
index d7f9332d5b..39bea35f9b 100644
--- a/iphone/Maps/Bookmarks/PlacePageVC.mm
+++ b/iphone/Maps/Bookmarks/PlacePageVC.mm
@@ -1,10 +1,11 @@
#import "PlacePageVC.h"
-#import "BalloonView.h"
#import "SelectSetVC.h"
-#import "EditDescriptionVC.h"
#import "Statistics.h"
#import "MapsAppDelegate.h"
#import "MapViewController.h"
+#import "TwoButtonsView.h"
+#import "ShareActionSheet.h"
+#import "PlaceAndCompasView.h"
#include "Framework.h"
#include "../../search/result.hpp"
@@ -13,7 +14,6 @@
@interface PinPickerView : UIView
- (id)initWithImage:(UIImage *)image;
-
+ (CGFloat)viewWidth;
+ (CGFloat)viewHeight;
@@ -57,13 +57,12 @@ CGFloat const pMargin = 10;
return self;
}
-// Enable accessibility for this view.
+//Enable accessibility for this view
- (BOOL)isAccessibilityElement
{
return YES;
}
-// Return a string that describes this view.
- (NSString *)accessibilityLabel
{
return self.titleLabel.text;
@@ -72,6 +71,13 @@ CGFloat const pMargin = 10;
@end
#define TEXTFIELD_TAG 999
+#define TEXTVIEW_TAG 666
+#define COORDINATE_TAG 333
+#define MARGIN 20
+#define SMALLMARGIN 10
+#define DESCRIPTIONHEIGHT 140
+#define TWOBUTTONSHEIGHT 44
+#define CELLHEIGHT 44
static NSString * const g_colors [] =
{
@@ -84,57 +90,135 @@ static NSString * const g_colors [] =
@"placemark-purple"
};
+typedef enum {Editing, Saved} Mode;
+
@interface PlacePageVC()
-@property (nonatomic, retain) UIView * viewWithPicker;
+{
+ int m_selectedRow;
+ Mode m_mode;
+ size_t m_categoryIndex;
+}
+
+@property (nonatomic, copy) UIView * viewWithPicker;
+
+@property(nonatomic, copy) NSString * pinTitle;
+// Currently displays bookmark description (notes)
+@property(nonatomic, copy) NSString * pinNotes;
+// Stores displayed bookmark icon file name
+@property(nonatomic, retain) NSString * pinColor;
+// If we clicked already existing bookmark, it will be here
+@property(nonatomic, assign) BookmarkAndCategory pinEditedBookmark;
+
+@property(nonatomic, assign) CGPoint pinGlobalPosition;
+@property(nonatomic, copy) NSString * pinType;
+@property (nonatomic, retain) NSArray * pinsArray;
+
+@property (nonatomic, retain) PlaceAndCompasView * placeAndCompass;
@end
@implementation PlacePageVC
-@synthesize pinsArray, viewWithPicker;
+- (id) initWithInfo:(search::AddressInfo const &)info point:(CGPoint)point
+{
+ self = [super initWithStyle:UITableViewStyleGrouped];
+ if (self)
+ {
+ char const * bestType = info.GetBestType();
+ char const * pinName = info.GetPinName().c_str();
+ [self initializeProperties:[NSString stringWithUTF8String:pinName ? pinName : ""]
+ notes:@""
+ color:@"placemark-red"
+ category:MakeEmptyBookmarkAndCategory() point:point
+ type:[NSString stringWithUTF8String: bestType ? bestType : ""]];
+ m_mode = Editing;
+ [self createPinPickerArray];
+ }
+ return self;
+}
+
+- (id) initWithApiPoint:(url_scheme::ApiPoint const &)apiPoint
+{
+ self = [super initWithStyle:UITableViewStyleGrouped];
+ if (self)
+ {
+ m_mode = Editing;
+ [self initializeProperties:[NSString stringWithUTF8String:apiPoint.m_name.c_str()]
+ notes:@""
+ color:@"placemark-red"
+ category:MakeEmptyBookmarkAndCategory()
+ point:CGPointMake(MercatorBounds::LonToX(apiPoint.m_lon), MercatorBounds::LatToY(apiPoint.m_lat))
+ type:@""];
+ [self createPinPickerArray];
+ }
+ return self;
+}
-- (id) initWithBalloonView:(BalloonView *)view
+- (id) initWithBookmark:(BookmarkAndCategory)bmAndCat
{
self = [super initWithStyle:UITableViewStyleGrouped];
if (self)
{
- m_balloon = view;
- self.title = m_balloon.title;
+ BookmarkCategory * cat = GetFramework().GetBmCategory(bmAndCat.first);
+ Bookmark * bm = cat->GetBookmark(bmAndCat.second);
+ search::AddressInfo info;
- NSMutableArray * viewArray = [[NSMutableArray alloc] init];
+ CGPoint const pt = CGPointMake(bm->GetOrg().x, bm->GetOrg().y);
+ GetFramework().GetAddressInfoForGlobalPoint(bm->GetOrg(), info);
- for (size_t i = 0; i < ARRAY_SIZE(g_colors); ++i)
- {
- PinPickerView * pinView = [[PinPickerView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@.png", g_colors[i]]]];
- [viewArray addObject:pinView];
- [pinView release];
- }
- self.pinsArray = viewArray;
- [viewArray release];
+ char const * c = info.GetBestType();
+
+ [self initializeProperties:[NSString stringWithUTF8String:bm->GetName().c_str()]
+ notes:[NSString stringWithUTF8String:bm->GetDescription().c_str()]
+ color:[NSString stringWithUTF8String:bm->GetType().c_str()]
+ category:bmAndCat
+ point:CGPointMake(pt.x, pt.y)
+ type:[NSString stringWithUTF8String: c ? c : ""]];
+
+ m_mode = Saved;
+ [self createPinPickerArray];
+ }
+ return self;
+}
+
+- (id) initWithName:(NSString *)name andGlobalPoint:(CGPoint)point
+{
+ self = [super initWithStyle:UITableViewStyleGrouped];
+ if (self)
+ {
+ m_mode = Editing;
+ [self initializeProperties:name
+ notes:@""
+ color:@"placemark-red"
+ category:MakeEmptyBookmarkAndCategory()
+ point:point
+ type:@""];
+ [self createPinPickerArray];
}
return self;
}
- (void) dealloc
{
- [pinsArray release];
- [viewWithPicker release];
+ self.pinsArray = nil;
+ self.viewWithPicker = nil;
+
+ self.pinTitle = nil;
+ self.pinNotes = nil;
+ self.pinColor = nil;
+ self.pinType = nil;
+ self.placeAndCompass = nil;
[super dealloc];
}
- (void)viewWillAppear:(BOOL)animated
{
- m_hideNavBar = YES;
- self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
[self.navigationController setNavigationBarHidden:NO animated:YES];
// Update the table - we can display it after changing set or color
[self.tableView reloadData];
- // Should be set to YES only if Remove Pin was pressed
- m_removePinOnClose = NO;
-
// Automatically show keyboard if bookmark has default name
- if ([m_balloon.title isEqualToString:NSLocalizedString(@"dropped_pin", nil)])
+ if ([_pinTitle isEqualToString:NSLocalizedString(@"dropped_pin", nil)])
[[[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]].contentView viewWithTag:TEXTFIELD_TAG] becomeFirstResponder];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
@@ -142,36 +226,23 @@ static NSString * const g_colors [] =
CGSize size = CGSizeMake(320, 480);
self.contentSizeForViewInPopover = size;
}
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged) name:UIDeviceOrientationDidChangeNotification object:nil];
-
[super viewWillAppear:animated];
}
-- (void)viewWillDisappear:(BOOL)animated
+-(void)viewDidLoad
{
- if (m_hideNavBar && ![[MapsAppDelegate theApp].m_mapViewController shouldShowNavBar])
- [self.navigationController setNavigationBarHidden:YES animated:YES];
- // Handle 3 scenarios:
- // 1. User pressed Remove Pin and goes back to the map - bookmark was deleted on click, do nothing
- // 2. User goes back to the map by pressing Map (Back) button - save possibly edited title, add bookmark
- // 3. User is changing Set or Color - save possibly edited title and update current balloon properties
- if (!m_removePinOnClose)
- {
- UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
- UITextField * f = (UITextField *)[cell viewWithTag:TEXTFIELD_TAG];
- if (f && f.text.length)
- m_balloon.title = f.text;
+ [super viewDidLoad];
+ self.title = self.pinTitle;
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged) name:UIDeviceOrientationDidChangeNotification object:nil];
+ if (m_mode == Editing)
+ [self addRightNavigationItemWithAction:@selector(save)];
+ else
+ [self addRightNavigationItemWithAction:@selector(edit)];
+}
- // We're going back to the map
- if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad && [self.navigationController.viewControllers indexOfObject:self] == NSNotFound)
- {
- [m_balloon addOrEditBookmark];
- [m_balloon clear];
- }
- }
+-(void)viewDidUnload
+{
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [super viewWillDisappear:animated];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
@@ -186,187 +257,114 @@ static NSString * const g_colors [] =
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
- switch (section)
- {
- case 0: return 3;
- case 1: return 1;
- case 2: return 1;
- case 3: return 1;
- default: return 0;
- }
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
- UITableViewCell * cell = nil;
- if (indexPath.section == 0)
- {
- NSString * cellId;
- switch (indexPath.row)
- {
- case 0: cellId = @"NameCellId"; break;
- case 1: cellId = @"SetCellId"; break;
- default: cellId = @"ColorCellId"; break;
- }
- cell = [tableView dequeueReusableCellWithIdentifier:cellId];
- if (!cell)
+ if (m_mode == Editing)
+ switch (section)
{
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellId] autorelease];
- switch (indexPath.row)
- {
- case 0:
- {
- cell.textLabel.text = NSLocalizedString(@"name", @"Add bookmark dialog - bookmark name");
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- // Temporary, to init font and color
- cell.detailTextLabel.text = @"temp string";
- // Called to initialize frames and fonts
- [cell layoutSubviews];
- CGRect const leftR = cell.textLabel.frame;
- CGFloat const padding = leftR.origin.x;
- CGRect r = CGRectMake(padding + leftR.size.width + padding, leftR.origin.y,
- cell.contentView.frame.size.width - 3 * padding - leftR.size.width, leftR.size.height);
- UITextField * f = [[[UITextField alloc] initWithFrame:r] autorelease];
- f.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
- f.enablesReturnKeyAutomatically = YES;
- f.returnKeyType = UIReturnKeyDone;
- f.clearButtonMode = UITextFieldViewModeWhileEditing;
- f.autocorrectionType = UITextAutocorrectionTypeNo;
- f.textAlignment = UITextAlignmentRight;
- f.textColor = cell.detailTextLabel.textColor;
- f.font = [cell.detailTextLabel.font fontWithSize:[cell.detailTextLabel.font pointSize]];
- f.tag = TEXTFIELD_TAG;
- f.delegate = self;
- f.autocapitalizationType = UITextAutocapitalizationTypeWords;
- // Reset temporary font
- cell.detailTextLabel.text = nil;
- [cell.contentView addSubview:f];
- }
- break;
-
- case 1:
- cell.textLabel.text = NSLocalizedString(@"set", @"Add bookmark dialog - bookmark set");
- cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
- break;
-
- case 2:
- cell.textLabel.text = NSLocalizedString(@"color", @"Add bookmark dialog - bookmark color");
- break;
- }
+ //name
+ case 0: return 1;
+ //set
+ case 1: return 1;
+ //color picker
+ case 2: return 1;
+ //description
+ case 3: return 1;
}
- // Update variable cell values
- switch (indexPath.row)
+ else
+ switch (section)
{
- case 0:
- ((UITextField *)[cell.contentView viewWithTag:TEXTFIELD_TAG]).text = m_balloon.title;
- break;
-
- case 1:
- cell.detailTextLabel.text = m_balloon.setName;
- break;
-
- case 2:
- // Create a copy of view here because it can't be subview in map view and in a cell simultaneously
- cell.accessoryView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:m_balloon.color]] autorelease];
- break;
+ //return zero, because want to use headers and footers
+ //coordinates cell
+ case 0: return 1;
+ case 1: return 0;
+ case 2: return 0;
}
- }
- else if (indexPath.section == 1)
+ return 0;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ if (indexPath.section == 3 && m_mode == Editing)
+ return DESCRIPTIONHEIGHT;
+ return CELLHEIGHT;
+}
+
+- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
+{
+ if (section == 0 && m_mode == Saved)
+ return self.placeAndCompass;
+ if (section == 1 && [self.pinNotes length] && m_mode == Saved)
{
- NSString * cellLabelText = NSLocalizedString(@"description", nil);
- cell = [tableView dequeueReusableCellWithIdentifier:cellLabelText];
- if (!cell)
- {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellLabelText] autorelease];
- cell.textLabel.text = cellLabelText;
- cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
- }
- cell.detailTextLabel.text = m_balloon.notes;
+ //Refactor we can do better
+ CGRect z = CGRectMake(0, 0, self.tableView.frame.size.width, [self getDescriptionHeight] + MARGIN);
+ UIView * view = [[[UIView alloc] initWithFrame:z] autorelease];
+ z.origin.x = SMALLMARGIN;
+ z.size.width -= SMALLMARGIN;
+ UITextView * textView = [[UITextView alloc] initWithFrame:z];
+ textView.scrollEnabled = NO;
+ textView.text = self.pinNotes;
+ textView.backgroundColor = [UIColor clearColor];
+ textView.font = [UIFont fontWithName:@"Helvetica" size:18];
+ textView.editable = NO;
+ [view addSubview:textView];
+ [textView release];
+ return view;
}
- else if (indexPath.section == 2)
+ return nil;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
+{
+ if (section == 0 && m_mode == Saved)
{
- cell = [tableView dequeueReusableCellWithIdentifier:@"SharePin"];
- if (!cell)
- {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SharePin"] autorelease];
- cell.textLabel.textAlignment = UITextAlignmentCenter;
- cell.textLabel.text = NSLocalizedString(@"share", nil);
- }
- }
- else
- {
- cell = [tableView dequeueReusableCellWithIdentifier:@"removePinCellId"];
- if (!cell)
- {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"removePinCellId"] autorelease];
- cell.textLabel.textAlignment = UITextAlignmentCenter;
- cell.textLabel.text = NSLocalizedString(@"remove_pin", @"Place Page - Remove Pin button");
- }
+ if (!_placeAndCompass)
+ _placeAndCompass = [[PlaceAndCompasView alloc] initWithName:self.pinTitle placeSecondaryName:[NSString stringWithUTF8String:GetFramework().GetBmCategory(_pinEditedBookmark.first)->GetName().c_str()] placeGlobalPoint:_pinGlobalPosition width:self.tableView.frame.size.width];
+ return self.placeAndCompass.frame.size.height;
}
- return cell;
+ if (section == 1 && [self.pinNotes length] && m_mode == Saved)
+ return [self getDescriptionHeight] + MARGIN;
+ return 0;
+}
+
+- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
+{
+ if (m_mode == Saved && section == 1)
+ return [[[TwoButtonsView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, TWOBUTTONSHEIGHT) leftButtonSelector:@selector(share) rightButtonSelector:@selector(remove) leftButtonTitle:NSLocalizedString(@"share", nil) rightButtontitle:NSLocalizedString(@"remove_pin", nil) target:self] autorelease];
+ return nil;
}
-- (void)onRemoveClicked
+- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
- [m_balloon deleteBookmark];
- [m_balloon clear];
+ if (section == 1 && m_mode == Saved)
+ return TWOBUTTONSHEIGHT;
+ return 0;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ UITableViewCell * cell = nil;
+ if (m_mode == Editing)
+ cell = [self cellForEditingModeWithTable:tableView cellForRowAtIndexPath:indexPath];
+ else
+ cell = [self cellForSaveModeWithTable:tableView cellForRowAtIndexPath:indexPath];
+ return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
-
- if (indexPath.section == 0)
+ if (m_mode == Editing)
{
- switch (indexPath.row)
+ if (indexPath.section == 1)
{
- case 1:
- {
- m_hideNavBar = NO;
- SelectSetVC * vc = [[SelectSetVC alloc] initWithBalloonView:m_balloon];
- [self pushToNavigationControllerAndSetControllerToPopoverSize:vc];
- [vc release];
- }
- break;
-
- case 2:
- {
- [self createAndShowColorPicker];
- }
- break;
+ SelectSetVC * vc = [[[SelectSetVC alloc] initWithIndex:&m_categoryIndex] autorelease];
+ [self pushToNavigationControllerAndSetControllerToPopoverSize:vc];
}
- }
- else if (indexPath.section == 1)
- {
- m_hideNavBar = NO;
- EditDescriptionVC * vc = [[EditDescriptionVC alloc] initWithBalloonView:m_balloon];
- [self pushToNavigationControllerAndSetControllerToPopoverSize:vc];
- [vc release];
- }
- else if (indexPath.section == 2)
- {
- UIActionSheet * as = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"share", nil) delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
- if ([MFMessageComposeViewController canSendText])
- [as addButtonWithTitle:NSLocalizedString(@"message", nil)];
- if ([MFMailComposeViewController canSendMail])
- [as addButtonWithTitle:NSLocalizedString(@"email", nil)];
- [as addButtonWithTitle:NSLocalizedString(@"copy_link", nil)];
- [as addButtonWithTitle:NSLocalizedString(@"cancel", nil)];
- [as setCancelButtonIndex:as.numberOfButtons - 1];
- [as showInView:self.view];
- [as release];
- }
- else
- {
- m_removePinOnClose = YES;
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
- [[MapsAppDelegate theApp].m_mapViewController dismissPopoverAndSaveBookmark:NO];
- else
+ else if (indexPath.section == 2)
{
- // Remove pin
- [self onRemoveClicked];
- [self.navigationController popViewControllerAnimated:YES];
+ [self.view endEditing:YES];
+ [self createAndShowColorPicker];
}
+ return;
}
}
@@ -374,13 +372,12 @@ static NSString * const g_colors [] =
{
if (textField.text.length == 0)
return YES;
-
// Hide keyboard
[textField resignFirstResponder];
- if (![textField.text isEqualToString:m_balloon.title])
+ if (![textField.text isEqualToString:_pinTitle])
{
- m_balloon.title = textField.text;
+ self.pinTitle = textField.text;
self.navigationController.title = textField.text;
}
return NO;
@@ -388,25 +385,7 @@ static NSString * const g_colors [] =
- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex
{
- UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
- UITextField * textF = (UITextField *)[cell viewWithTag:TEXTFIELD_TAG];
- if ([[actionSheet buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"email", nil)])
- {
- // Not really beutiful now, but ...
- BOOL isMyPosition = [textF.text isEqualToString:NSLocalizedString(@"my_position", nil)];
- NSString * shortUrl = [self generateShortUrlwithName:isMyPosition ? @"" : textF.text];
-
- [self sendEmailWith:textF.text andUrl:shortUrl];
- }
- else if ([[actionSheet buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"message", nil)])
- {
- NSString * shortUrl = [self generateShortUrlwithName:@""];
- [self sendMessageWith:textF.text andUrl:shortUrl];
- }
- else if ([[actionSheet buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"copy_link", nil)])
- {
- [UIPasteboard generalPasteboard].string = [self generateShortUrlwithName:textF.text];
- }
+ [ShareActionSheet resolveActionSheetChoice:actionSheet buttonIndex:buttonIndex text:self.pinTitle view:self delegate:self scale:GetFramework().GetDrawScale() gX:_pinGlobalPosition.x gY:_pinGlobalPosition.y andMyPosition:NO];
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
@@ -421,58 +400,6 @@ static NSString * const g_colors [] =
[self dismissModalViewControllerAnimated:YES];
}
--(void)sendEmailWith:(NSString *)textFieldText andUrl:(NSString *)shortUrl
-{
- MFMailComposeViewController * mailVC = [[[MFMailComposeViewController alloc] init] autorelease];
- NSString * httpGe0Url = [shortUrl stringByReplacingCharactersInRange:NSMakeRange(0, 6) withString:@"http://ge0.me/"];
-
- if ([textFieldText isEqualToString:NSLocalizedString(@"my_position", nil)])
- {
- search::AddressInfo info;
- m2::PointD pt = m2::PointD(m_balloon.globalPosition.x, m_balloon.globalPosition.y);
- GetFramework().GetAddressInfoForGlobalPoint(pt, info);
- NSString * nameAndAddress = [NSString stringWithUTF8String:info.FormatNameAndAddress().c_str()];
- [mailVC setMessageBody:[NSString stringWithFormat:NSLocalizedString(@"my_position_share_email", nil), nameAndAddress, shortUrl, httpGe0Url] isHTML:NO];
- [mailVC setSubject:NSLocalizedString(@"my_position_share_email_subject", nil)];
- }
- else
- {
- [mailVC setMessageBody:[NSString stringWithFormat:NSLocalizedString(@"bookmark_share_email", nil), textFieldText, shortUrl, httpGe0Url] isHTML:NO];
- [mailVC setSubject:NSLocalizedString(@"bookmark_share_email_subject", nil)];
- }
-
- mailVC.mailComposeDelegate = self;
- [self presentModalViewController:mailVC animated:YES];
-}
-
--(void)sendMessageWith:(NSString *)textFieldText andUrl:(NSString *)shortUrl
-{
- NSString * httpGe0Url = [shortUrl stringByReplacingCharactersInRange:NSMakeRange(0, 6) withString:@"http://ge0.me/"];
- MFMessageComposeViewController * messageVC = [[[MFMessageComposeViewController alloc] init] autorelease];
-
- if ([textFieldText isEqualToString:NSLocalizedString(@"my_position", nil)])
- [messageVC setBody:[NSString stringWithFormat:NSLocalizedString(@"my_position_share_sms", nil), shortUrl, httpGe0Url]];
- else
- [messageVC setBody:[NSString stringWithFormat:NSLocalizedString(@"bookmark_share_sms", nil), shortUrl, httpGe0Url]];
-
- messageVC.messageComposeDelegate = self;
- [self presentModalViewController:messageVC animated:YES];
-}
-
--(BOOL)canShare
-{
- return [MFMessageComposeViewController canSendText] || [MFMailComposeViewController canSendMail];
-}
-
--(NSString *)generateShortUrlwithName:(NSString *) name
-{
- Framework & f = GetFramework();
- return [NSString stringWithUTF8String:(f.CodeGe0url(MercatorBounds::YToLat(m_balloon.globalPosition.y),
- MercatorBounds::XToLon(m_balloon.globalPosition.x),
- f.GetBmCategory(m_balloon.editedBookmark.first)->GetBookmark(m_balloon.editedBookmark.second)->GetScale(),
- [name UTF8String])).c_str()];
-}
-
-(void)pushToNavigationControllerAndSetControllerToPopoverSize:(UIViewController *)vc
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
@@ -480,7 +407,6 @@ static NSString * const g_colors [] =
[self.navigationController pushViewController:vc animated:YES];
}
-
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component
{
return [PinPickerView viewWidth];
@@ -493,7 +419,7 @@ static NSString * const g_colors [] =
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
- return [pinsArray count];
+ return [_pinsArray count];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
@@ -501,27 +427,24 @@ static NSString * const g_colors [] =
return 1;
}
-
#pragma mark - UIPickerViewDelegate
-
-// tell the picker which view to use for a given component and row, we have an array of views to show
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
forComponent:(NSInteger)component reusingView:(UIView *)view
{
- return [pinsArray objectAtIndex:row];
+ return [_pinsArray objectAtIndex:row];
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
- selectedRow = row;
+ m_selectedRow = row;
}
-(void)pickerDoneClicked
{
- if (![m_balloon.color isEqualToString:g_colors[selectedRow]])
+ if (![_pinColor isEqualToString:g_colors[m_selectedRow]])
{
[[Statistics instance] logEvent:@"Select Bookmark color"];
- m_balloon.color = g_colors[selectedRow];
+ self.pinColor = g_colors[m_selectedRow];
[self.tableView reloadData];
}
[self pickerCancelClicked];
@@ -530,7 +453,7 @@ static NSString * const g_colors [] =
-(void)pickerCancelClicked
{
self.tableView.scrollEnabled = YES;
- [viewWithPicker removeFromSuperview];
+ [_viewWithPicker removeFromSuperview];
self.viewWithPicker = nil;
}
@@ -538,19 +461,18 @@ static NSString * const g_colors [] =
{
double height, width;
CGRect rect;
- [self getScreenHeight:height width:width rect:rect];
+ [self getSuperView:height width:width rect:rect];
- viewWithPicker = [[UIView alloc] initWithFrame:rect];
+ _viewWithPicker = [[UIView alloc] initWithFrame:rect];
UIPickerView * picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 0.0)];
picker.delegate = self;
picker.showsSelectionIndicator = YES;
CGRect r = picker.frame;
[picker setCenter:CGPointMake(width / 2, height - r.size.height / 2)];
- [viewWithPicker addSubview:picker];
+ [_viewWithPicker addSubview:picker];
- UIToolbar * pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, picker.frame.origin.y - 44, width, 44)];
+ UIToolbar * pickerToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, picker.frame.origin.y - CELLHEIGHT, width, CELLHEIGHT)];
pickerToolbar.barStyle = UIBarStyleBlackOpaque;
- //[pickerToolbar sizeToFit];
NSMutableArray *barItems = [[NSMutableArray alloc] init];
UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(pickerDoneClicked)];
@@ -561,69 +483,314 @@ static NSString * const g_colors [] =
[pickerToolbar setItems:barItems animated:YES];
[barItems release];
-
[picker release];
- [viewWithPicker addSubview:pickerToolbar];
+ [_viewWithPicker addSubview:pickerToolbar];
[pickerToolbar release];
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad)
{
UIWindow* window = [UIApplication sharedApplication].keyWindow;
if (!window)
window = [[UIApplication sharedApplication].windows objectAtIndex:0];
- [[[window subviews] objectAtIndex:0] addSubview:viewWithPicker];
+ [[[window subviews] objectAtIndex:0] addSubview:_viewWithPicker];
}
else
+ [self.view.superview addSubview:_viewWithPicker];
+ self.tableView.scrollEnabled = NO;
+ m_selectedRow = 0;
+}
+
+-(void)getSuperView:(double &)height width:(double &)width rect:(CGRect &)rect
+{
+ if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad)
{
- [self.view.superview addSubview:viewWithPicker];
+ rect = [UIScreen mainScreen].bounds;
+ height = self.view.window.frame.size.height;
+ width = self.view.window.frame.size.width;
+ if(!UIInterfaceOrientationIsPortrait(self.interfaceOrientation))
+ std::swap(height, width);
}
+ else
+ {
+ height = self.view.superview.frame.size.height;
+ width = self.view.superview.frame.size.width;
+ rect = self.view.superview.frame;
+ }
+}
- self.tableView.scrollEnabled = NO;
+-(void)addRightNavigationItemWithAction:(SEL)selector
+{
+ UIBarButtonItem * but;
+ if (m_mode == Saved)
+ but = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:selector];
+ else
+ but = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:selector];
+ self.navigationItem.rightBarButtonItem = but;
+ [but release];
+}
- selectedRow = 0;
+-(void)save
+{
+ [self.view endEditing:YES];
+ m_mode = Saved;
+ UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
+ if (!cell)
+ cell = [self.tableView dequeueReusableCellWithIdentifier:@"EditingNameCellId"];
+ UITextField * f = (UITextField *)[cell viewWithTag:TEXTFIELD_TAG];
+ self.pinTitle = f.text;
+ cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:3]];
+ if (!cell)
+ cell = [self.tableView dequeueReusableCellWithIdentifier:@"EditingDF"];
+ UITextView * t = (UITextView *)[cell viewWithTag:TEXTVIEW_TAG];
+ self.pinNotes = t.text;
+ [self savePin];
+ [self goToTheMap];
+ GetFramework().GetBalloonManager().Hide();
+}
+
+-(void)edit
+{
+ m_mode = Editing;
+ [self.tableView reloadData];
+ [self addRightNavigationItemWithAction:@selector(save)];
}
--(void) orientationChanged
+-(void)remove
{
- if (viewWithPicker)
+ if (IsValid(_pinEditedBookmark))
{
- double height, width;
- CGRect rect;
- [self getScreenHeight:height width:width rect:rect];
- [viewWithPicker setFrame:rect];
+ BookmarkCategory * cat = GetFramework().GetBmCategory(_pinEditedBookmark.first);
+ if (cat->GetBookmarksCount() > _pinEditedBookmark.second)
+ {
+ cat->DeleteBookmark(_pinEditedBookmark.second);
+ cat->SaveToKMLFile();
+ }
+ }
+ [self goToTheMap];
+}
- NSArray *subviews = [viewWithPicker subviews];
+-(void)share
+{
+ [ShareActionSheet showShareActionSheetInView:self.view withObject:self];
+}
+
+-(void)createPinPickerArray
+{
+ NSMutableArray * viewArray = [[NSMutableArray alloc] init];
+ for (size_t i = 0; i < ARRAY_SIZE(g_colors); ++i)
+ {
+ PinPickerView * pinView = [[PinPickerView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@.png", g_colors[i]]]];
+ [viewArray addObject:pinView];
+ [pinView release];
+ }
+ self.pinsArray = viewArray;
+ [viewArray release];
+}
- UIPickerView * p = nil;
- UIToolbar * t = nil;
- for (UIView *subview in subviews)
+-(void)savePin
+{
+ Framework & f = GetFramework();
+ if (_pinEditedBookmark == MakeEmptyBookmarkAndCategory())
+ [self addBookmarkToCategory:m_categoryIndex];
+ else
+ {
+ BookmarkCategory * cat = f.GetBmCategory(_pinEditedBookmark.first);
+ if (_pinEditedBookmark.first != m_categoryIndex)
{
- if ([subview isKindOfClass:[UIPickerView class]])
- p = (UIPickerView *)subview;
- else if ([subview isKindOfClass:[UIToolbar class]])
- t = (UIToolbar *)subview;
+ cat->DeleteBookmark(_pinEditedBookmark.second);
+ cat->SaveToKMLFile();
+ [self addBookmarkToCategory:m_categoryIndex];
+ }
+ else
+ {
+ Bookmark * bm = cat->GetBookmark(_pinEditedBookmark.second);
+ bm->SetName([self.pinTitle UTF8String]);
+ bm->SetType([self.pinColor UTF8String]);
+ bm->SetDescription([self.pinNotes UTF8String]);
+ cat->SaveToKMLFile();
}
- [p setFrame:CGRectMake(0, height - p.frame.size.height, width, p.frame.size.height)];
- [t setFrame:CGRectMake(0, p.frame.origin.y - 44, width, 44)];
}
}
--(void)getScreenHeight:(double &)height width:(double &)width rect:(CGRect &)rect
+-(void)addBookmarkToCategory:(size_t)index
{
- if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad)
+ BookmarkCategory * cat = GetFramework().GetBmCategory(index);
+ Bookmark bm(m2::PointD(_pinGlobalPosition.x, _pinGlobalPosition.y), [self.pinTitle UTF8String], [self.pinColor UTF8String]);
+ bm.SetDescription([self.pinNotes UTF8String]);
+ cat->AddBookmark(bm);
+ cat->SaveToKMLFile();
+ _pinEditedBookmark = pair<int, int>(index, cat->GetBookmarksCount() - 1);
+}
+
+-(void)initializeProperties:(NSString *)name notes:(NSString *)notes color:(NSString *)color category:(BookmarkAndCategory) bmAndCat point:
+ (CGPoint)point type:(NSString *)type
+{
+ self.pinTitle = name;
+ self.pinNotes = notes;
+ self.pinColor = color;
+ self.pinEditedBookmark =bmAndCat;
+ m_categoryIndex = bmAndCat.first == - 1 ? GetFramework().LastEditedCategory():bmAndCat.first;
+ self.pinGlobalPosition = point;
+ self.pinType = type;
+}
+
+-(UITextView *)createTextFieldForCell:(UIFont *)font color:(UIColor *)color
+{
+ UITextView * txtView = [[[UITextView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 142.0)] autorelease];
+ txtView.delegate = self;
+ txtView.AutoresizingMask = UIViewAutoresizingFlexibleWidth;
+ txtView.textColor = color;
+ txtView.font = font;
+ txtView.backgroundColor = [UIColor clearColor];
+ txtView.tag = TEXTVIEW_TAG;
+ return txtView;
+}
+
+-(UITableViewCell *)cellForEditingModeWithTable:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ NSString * cellId;
+ switch (indexPath.section)
{
- rect = [UIScreen mainScreen].bounds;
- height = self.view.window.frame.size.height;
- width = self.view.window.frame.size.width;
- if(!UIInterfaceOrientationIsPortrait(self.interfaceOrientation))
- std::swap(height, width);
+ case 0: cellId = @"EditingNameCellId"; break;
+ case 1: cellId = @"EditingSetCellId"; break;
+ case 2: cellId = @"EditingColorCellId"; break;
+ default: cellId = @"EditingDF"; break;
+ }
+ UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellId];
+ if (!cell)
+ {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellId] autorelease];
+ if (indexPath.section == 0)
+ {
+ cell.textLabel.text = NSLocalizedString(@"name", @"Add bookmark dialog - bookmark name");
+ cell.selectionStyle = UITableViewCellSelectionStyleNone;
+ // Temporary, to init font and color
+ cell.detailTextLabel.text = @"temp string";
+ // Called to initialize frames and fonts
+ [cell layoutSubviews];
+ CGRect const leftR = cell.textLabel.frame;
+ CGFloat const padding = leftR.origin.x;
+ CGRect r = CGRectMake(padding + leftR.size.width + padding, leftR.origin.y,
+ cell.contentView.frame.size.width - 3 * padding - leftR.size.width, leftR.size.height);
+ UITextField * f = [[[UITextField alloc] initWithFrame:r] autorelease];
+ f.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ f.enablesReturnKeyAutomatically = YES;
+ f.returnKeyType = UIReturnKeyDone;
+ f.clearButtonMode = UITextFieldViewModeWhileEditing;
+ f.autocorrectionType = UITextAutocorrectionTypeNo;
+ f.textAlignment = UITextAlignmentRight;
+ f.textColor = cell.detailTextLabel.textColor;
+ f.font = [cell.detailTextLabel.font fontWithSize:[cell.detailTextLabel.font pointSize]];
+ f.tag = TEXTFIELD_TAG;
+ f.delegate = self;
+ f.autocapitalizationType = UITextAutocapitalizationTypeWords;
+ // Reset temporary font
+ cell.detailTextLabel.text = nil;
+ [cell.contentView addSubview:f];
+ }
+ else if (indexPath.section == 1)
+ {
+ cell.textLabel.text = NSLocalizedString(@"set", @"Add bookmark dialog - bookmark set");
+ cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+ }
+ else if (indexPath.section == 2)
+ {
+ cell.textLabel.text = NSLocalizedString(@"color", @"Add bookmark dialog - bookmark color");
+ }
+ else if (indexPath.section == 3)
+ {
+ cell.selectionStyle = UITableViewCellSelectionStyleNone;
+ // Temporary, to init font and color
+ cell.detailTextLabel.text = @"temp string";
+ // Called to initialize frames and fonts
+ [cell layoutSubviews];
+ UITextView * txtView = [[[UITextView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 142.0)] autorelease];
+ txtView.delegate = self;
+ txtView.AutoresizingMask = UIViewAutoresizingFlexibleWidth;
+ txtView.textColor = cell.detailTextLabel.textColor;
+ txtView.font = [cell.detailTextLabel.font fontWithSize:[cell.detailTextLabel.font pointSize]];
+ txtView.backgroundColor = [UIColor clearColor];
+ txtView.tag = TEXTVIEW_TAG;
+ cell.detailTextLabel.text = @"";
+ [cell.contentView addSubview:txtView];
+ txtView.delegate = self;
+ }
+ }
+ switch (indexPath.section)
+ {
+ case 0:
+ ((UITextField *)[cell.contentView viewWithTag:TEXTFIELD_TAG]).text = self.pinTitle;
+ break;
+
+ case 1:
+ cell.detailTextLabel.text = [NSString stringWithUTF8String:GetFramework().GetBmCategory(m_categoryIndex)->GetName().c_str()];
+ break;
+ case 2:
+ cell.accessoryView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:_pinColor]] autorelease];
+ break;
+ case 3:
+ UITextView * t = (UITextView *)[cell viewWithTag:TEXTVIEW_TAG];
+ t.text = self.pinNotes;
+ break;
}
- else
+ return cell;
+}
+
+-(UITableViewCell *)cellForSaveModeWithTable:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+ UITableViewCell * cell = nil;
+ if (indexPath.section == 0)
{
- height = self.view.superview.frame.size.height;
- width = self.view.superview.frame.size.width;
- rect = self.view.superview.frame;
+ cell = [tableView dequeueReusableCellWithIdentifier:@"CoordinatesCELL"];
+ if (!cell)
+ {
+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"CoordinatesCELL"] autorelease];
+ cell.textLabel.text = @"Temporary Name";
+ [cell layoutSubviews];
+ UITextField * f = [[UITextField alloc] initWithFrame:cell.contentView.frame];
+ f.tag = COORDINATE_TAG;
+ f.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ f.returnKeyType = UIReturnKeyDone;
+ f.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
+ f.font = [UIFont fontWithName:@"Helvetica" size:26];
+ f.textAlignment = UITextAlignmentCenter;
+ f.userInteractionEnabled = NO;
+ f.delegate = self;
+ [cell.contentView addSubview:f];
+ [f release];
+ cell.textLabel.text = @"";
+ [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
+ }
+ UITextField * f = (UITextField *)[cell viewWithTag:COORDINATE_TAG];
+ f.text = [NSString stringWithFormat:@"%f %f", MercatorBounds::YToLat(self.pinGlobalPosition.y),
+ MercatorBounds::XToLon(self.pinGlobalPosition.x)];
}
+ return cell;
+}
+
+-(void)orientationChanged
+{
+ [self.placeAndCompass drawView];
+ [self.tableView reloadData];
}
+-(void)goToTheMap
+{
+ GetFramework().GetBalloonManager().Hide();
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+ [[MapsAppDelegate theApp].m_mapViewController dismissPopover];
+ else
+ [self.navigationController popToRootViewControllerAnimated:YES];
+}
+
+-(CGFloat)getDescriptionHeight
+{
+ return [self.pinNotes sizeWithFont:[UIFont fontWithName:@"Helvetica" size:18] constrainedToSize:CGSizeMake(self.tableView.frame.size.width - 3 * SMALLMARGIN, CGFLOAT_MAX) lineBreakMode:NSLineBreakByCharWrapping].height;
+}
+
+- (void)textViewDidEndEditing:(UITextView *)textView
+{
+ if (textView.tag == TEXTVIEW_TAG)
+ self.pinNotes = textView.text;
+}
@end
diff --git a/iphone/Maps/Bookmarks/SelectSetVC.h b/iphone/Maps/Bookmarks/SelectSetVC.h
index 63cb772b5a..5351b1a3d2 100644
--- a/iphone/Maps/Bookmarks/SelectSetVC.h
+++ b/iphone/Maps/Bookmarks/SelectSetVC.h
@@ -1,13 +1,9 @@
#import <UIKit/UIKit.h>
-@class BalloonView;
-
@interface SelectSetVC : UITableViewController
{
- // @TODO store as a property to retain reference
- BalloonView * m_balloon;
+ size_t * m_index;
}
-
-- (id) initWithBalloonView:(BalloonView *)view;
+- (id) initWithIndex:(size_t *)index;
@end
diff --git a/iphone/Maps/Bookmarks/SelectSetVC.mm b/iphone/Maps/Bookmarks/SelectSetVC.mm
index d54af4242a..97341c35d9 100644
--- a/iphone/Maps/Bookmarks/SelectSetVC.mm
+++ b/iphone/Maps/Bookmarks/SelectSetVC.mm
@@ -1,17 +1,15 @@
#import "SelectSetVC.h"
-#import "BalloonView.h"
#import "Framework.h"
#import "AddSetVC.h"
@implementation SelectSetVC
-- (id) initWithBalloonView:(BalloonView *)view
+- (id) initWithIndex:(size_t *)index
{
self = [super initWithStyle:UITableViewStyleGrouped];
if (self)
{
- m_balloon = view;
-
+ m_index = index;
self.title = NSLocalizedString(@"bookmark_sets", @"Bookmark Sets dialog title");
}
return self;
@@ -54,7 +52,7 @@
if (cat)
cell.textLabel.text = [NSString stringWithUTF8String:cat->GetName().c_str()];
- if (m_balloon.editedBookmark.first == indexPath.row)
+ if ((*m_index) == indexPath.row)
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryNone;
@@ -67,7 +65,7 @@
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section == 0)
{
- AddSetVC * asVC = [[AddSetVC alloc] initWithBalloonView:m_balloon];
+ AddSetVC * asVC = [[AddSetVC alloc] initWithIndex:m_index];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
[asVC setContentSizeForViewInPopover:[self contentSizeForViewInPopover]];
[self.navigationController pushViewController:asVC animated:YES];
@@ -75,11 +73,8 @@
}
else
{
- [m_balloon deleteBookmark];
- [m_balloon addBookmarkToCategory:indexPath.row];
-
+ *m_index = indexPath.row;
[self.navigationController popViewControllerAnimated:YES];
}
}
-
@end
diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h
index b5f97afa5d..aa51c74df3 100644
--- a/iphone/Maps/Classes/MapViewController.h
+++ b/iphone/Maps/Classes/MapViewController.h
@@ -6,7 +6,6 @@
namespace search { struct AddressInfo; }
-@class BalloonView;
@interface MapViewController : UIViewController <LocationObserver, UIAlertViewDelegate, UIPopoverControllerDelegate>
{
@@ -21,10 +20,11 @@ namespace search { struct AddressInfo; }
size_t m_StickyThreshold;
m2::PointD m_Pt1, m_Pt2;
- BalloonView * m_balloonView;
/// Temporary solution to improve long touch detection.
m2::PointD m_touchDownPoint;
- UIPopoverController * popover;
+
+ UIPopoverController * m_popover;
+ CGPoint m_popoverPos;
}
- (void) SetupMeasurementSystem;
@@ -42,10 +42,11 @@ namespace search { struct AddressInfo; }
- (void)showSearchResultAsBookmarkAtMercatorPoint:(m2::PointD const &)pt withInfo:(search::AddressInfo const &)info;
- (void)showBalloonWithCategoryIndex:(int)cat andBookmarkIndex:(int)bm;
-- (void)dismissPopoverAndSaveBookmark:(BOOL)save;
- (void)prepareForApi;
- (BOOL)shouldShowNavBar;
+- (void)dismissPopover;
+
@property (nonatomic, retain) IBOutlet UIButton * m_myPositionButton;
@property (nonatomic, assign) BOOL isApiMode;
diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm
index 28d6869df2..319e73c775 100644
--- a/iphone/Maps/Classes/MapViewController.mm
+++ b/iphone/Maps/Classes/MapViewController.mm
@@ -2,10 +2,10 @@
#import "SearchVC.h"
#import "MapsAppDelegate.h"
#import "EAGLView.h"
-#import "BalloonView.h"
#import "BookmarksRootVC.h"
#import "PlacePageVC.h"
#import "GetActiveConnectionType.h"
+#import "PlacePreviewViewController.h"
#import "../Settings/SettingsManager.h"
@@ -27,7 +27,6 @@
#define FACEBOOK_ALERT_VIEW 1
#define APPSTORE_ALERT_VIEW 2
-#define BALLOON_PROPOSAL_ALERT_VIEW 11
#define ITUNES_URL @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%lld"
#define FACEBOOK_URL @"http://www.facebook.com/MapsWithMe"
#define FACEBOOK_SCHEME @"fb://profile/111923085594432"
@@ -98,7 +97,7 @@ const long long LITE_IDL = 431183278L;
f.OnLocationUpdate(info);
- [self showPopoverFromBalloonData];
+ [self showPopover];
}
- (void) onCompassUpdate:(location::CompassInfo const &)info
@@ -215,65 +214,15 @@ const long long LITE_IDL = 431183278L;
- (IBAction)OnBookmarksClicked:(id)sender
{
- BookmarksRootVC * bVC = [[BookmarksRootVC alloc] initWithBalloonView:m_balloonView];
+ BookmarksRootVC * bVC = [[BookmarksRootVC alloc] init];
UINavigationController * navC = [[UINavigationController alloc] initWithRootViewController:bVC];
[self presentModalViewController:navC animated:YES];
[bVC release];
[navC release];
}
-- (void) onBalloonClicked:(m2::PointD const &)pt withInfo:(search::AddressInfo const &)info
-{
- // Disable bookmarks for free version
- if (!GetPlatform().IsPro())
- {
- // Display banner for paid version
- UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"bookmarks_in_pro_version", nil)
- message:nil
- delegate:self
- cancelButtonTitle:NSLocalizedString(@"cancel", nil)
- otherButtonTitles:NSLocalizedString(@"get_it_now", nil), nil];
- alert.tag = BALLOON_PROPOSAL_ALERT_VIEW;
-
- [alert show];
- [alert release];
- }
- else
- {
- PlacePageVC * placePageVC = nil;
- if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
- {
- UINavigationController * navC = [[UINavigationController alloc] init];
- popover = [[UIPopoverController alloc] initWithContentViewController:navC];
- popover.delegate = self;
-
- placePageVC = [[PlacePageVC alloc] initWithBalloonView:m_balloonView];
- [navC pushViewController:placePageVC animated:YES];
- [navC release];
-
- [popover setPopoverContentSize:CGSizeMake(320, 480)];
- [self showPopoverFromBalloonData];
- }
- else
- {
- placePageVC = [[PlacePageVC alloc] initWithBalloonView:m_balloonView];
- [self.navigationController pushViewController:placePageVC animated:YES];
- }
- Framework & f = GetFramework();
- if (!IsValid(m_balloonView.editedBookmark))
- {
- int categoryPos = f.LastEditedCategory();
- [m_balloonView addBookmarkToCategory:categoryPos];
- }
-
- [placePageVC release];
- }
-}
-
- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController
{
- [m_balloonView addOrEditBookmark];
- [m_balloonView clear];
[self destroyPopover];
[self Invalidate];
}
@@ -282,7 +231,7 @@ const long long LITE_IDL = 431183278L;
{
CGFloat const scaleFactor = self.view.contentScaleFactor;
m2::PointD pxClicked(point.x * scaleFactor, point.y * scaleFactor);
- GetFramework().GetBalloonManager().OnClick(m2::PointD(pxClicked.x, pxClicked.y), isLongClick == YES);
+ GetFramework().GetBalloonManager().OnClick(m2::PointD(pxClicked.x, pxClicked.y), isLongClick);
}
- (void) onSingleTap:(NSValue *)point
@@ -302,13 +251,7 @@ const long long LITE_IDL = 431183278L;
- (void)showBalloonWithCategoryIndex:(int)cat andBookmarkIndex:(int)bm
{
- // TODO:
-}
-
-- (void) dealloc
-{
- [m_balloonView release];
- [super dealloc];
+ GetFramework().GetBalloonManager().ShowBookmark(BookmarkAndCategory(cat,bm));
}
- (id) initWithCoder: (NSCoder *)coder
@@ -319,9 +262,6 @@ const long long LITE_IDL = 431183278L;
{
self.title = NSLocalizedString(@"back", @"Back button in nav bar to show the map");
- // Helper to display/hide pin on screen tap
- m_balloonView = [[BalloonView alloc] initWithTarget:self];
-
Framework & f = GetFramework();
typedef void (*POSITIONBalloonFnT)(id,SEL, double, double);
@@ -368,6 +308,7 @@ const long long LITE_IDL = 431183278L;
_isApiMode = NO;
f.Invalidate();
+ f.LoadBookmarks();
}
NSLog(@"MapViewController initWithCoder Ended");
@@ -589,7 +530,7 @@ NSInteger compareAddress(id l, id r, void * context)
- (void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation) fromInterfaceOrientation
{
[[MapsAppDelegate theApp].m_locationManager setOrientation:self.interfaceOrientation];
- [self showPopoverFromBalloonData];
+ [self showPopover];
[self Invalidate];
}
@@ -688,20 +629,6 @@ NSInteger compareAddress(id l, id r, void * context)
default:
break;
}
-
- if (alertView.tag == BALLOON_PROPOSAL_ALERT_VIEW)
- {
- if (buttonIndex != alertView.cancelButtonIndex)
- {
- // Launch appstore
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:MAPSWITHME_PREMIUM_APPSTORE_URL]];
- [[Statistics instance] logProposalReason:@"Balloon Touch" withAnswer:@"YES"];
- }
- else
- {
- [[Statistics instance] logProposalReason:@"Balloon Touch" withAnswer:@"NO"];
- }
- }
}
-(void) manageAlert:(NSInteger)buttonIndex andUrl:(NSURL*)url andDlgSetting:(dlg_settings::DialogT)set
@@ -731,34 +658,21 @@ NSInteger compareAddress(id l, id r, void * context)
- (void) destroyPopover
{
- [popover release];
- popover = nil;
+ [m_popover release];
+ m_popover = nil;
}
-//if save is NO, we need to delete bookmark
-- (void)dismissPopoverAndSaveBookmark:(BOOL)save
+-(void)showPopover
{
- if (IsValid(m_balloonView.editedBookmark))
- {
- if (save)
- [m_balloonView addOrEditBookmark];
- else
- [m_balloonView deleteBookmark];
- [m_balloonView clear];
- }
- [popover dismissPopoverAnimated:YES];
- [self destroyPopover];
- [self Invalidate];
-}
+ if (m_popover)
+ GetFramework().GetBalloonManager().Hide();
--(void)showPopoverFromBalloonData
-{
- m2::PointD pt = GetFramework().GtoP(m2::PointD(m_balloonView.globalPosition.x, m_balloonView.globalPosition.y));
double const sf = self.view.contentScaleFactor;
- pt.x /= sf;
- pt.y /= sf;
- [popover presentPopoverFromRect:CGRectMake(pt.x, pt.y, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
+ Framework & f = GetFramework();
+ m2::PointD tmp = m2::PointD(f.GtoP(m2::PointD(m_popoverPos.x, m_popoverPos.y)));
+
+ [m_popover presentPopoverFromRect:CGRectMake(tmp.x / sf, tmp.y / sf, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
- (void)prepareForApi
@@ -796,24 +710,64 @@ NSInteger compareAddress(id l, id r, void * context)
return (_isApiMode && [backUrl length] && [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:backUrl]]);
}
+- (void)dismissPopover
+{
+ [m_popover dismissPopoverAnimated:YES];
+ [self destroyPopover];
+ [self Invalidate];
+}
+
-(void)positionBallonClickedLat:(double)lat lon:(double)lon
{
- NSLog(@"Position");
+ CGPoint const p = CGPointMake(MercatorBounds::LonToX(lon), MercatorBounds::LatToY(lat));
+ PlacePreviewViewController * preview = [[PlacePreviewViewController alloc] initWithPoint:p];
+ m_popoverPos = p;
+ [self pushViewController:preview];
+ [preview release];
}
-(void)poiBalloonClicked:(m2::PointD const &)pt info:(search::AddressInfo const &)info
{
- NSLog(@"poi");
+ PlacePreviewViewController * preview = [[PlacePreviewViewController alloc] initWith:info point:CGPointMake(pt.x, pt.y)];
+ m_popoverPos = CGPointMake(pt.x, pt.y);
+ [self pushViewController:preview];
+ [preview release];
}
-(void)apiBalloonClicked:(url_scheme::ApiPoint const &) apiPoint
{
- NSLog(@"api");
+ PlacePreviewViewController * apiPreview = [[PlacePreviewViewController alloc] initWithApiPoint:apiPoint];
+ m_popoverPos = CGPointMake(MercatorBounds::LonToX(apiPoint.m_lon), MercatorBounds::LatToY(apiPoint.m_lat));
+ [self pushViewController:apiPreview];
+ [apiPreview release];
}
-(void)bookmarkBalloonClicked:(BookmarkAndCategory const &) bmAndCat
{
- NSLog(@"bookmark");
+ PlacePageVC * vc = [[PlacePageVC alloc] initWithBookmark:bmAndCat];
+ Bookmark const * bm = GetFramework().GetBmCategory(bmAndCat.first)->GetBookmark(bmAndCat.second);
+ m_popoverPos = CGPointMake(bm->GetOrg().x, bm->GetOrg().y);
+ [self pushViewController:vc];
+ [vc release];
+}
+
+-(void)pushViewController:(UIViewController *)vc
+{
+ if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+ {
+ UINavigationController * navC = [[UINavigationController alloc] init];
+ m_popover = [[UIPopoverController alloc] initWithContentViewController:navC];
+ m_popover.delegate = self;
+
+ [navC pushViewController:vc animated:YES];
+ [navC release];
+ navC.navigationBar.barStyle = UIBarStyleBlack;
+
+ [m_popover setPopoverContentSize:CGSizeMake(320, 480)];
+ [self showPopover];
+ }
+ else
+ [self.navigationController pushViewController:vc animated:YES];
}
@end
diff --git a/iphone/Maps/Classes/MapsAppDelegate.h b/iphone/Maps/Classes/MapsAppDelegate.h
index 701039881d..ca03066386 100644
--- a/iphone/Maps/Classes/MapsAppDelegate.h
+++ b/iphone/Maps/Classes/MapsAppDelegate.h
@@ -4,7 +4,7 @@
@class SettingsManager;
@class LocationManager;
-@interface MapsAppDelegate : NSObject <UIApplicationDelegate, UIAlertViewDelegate>
+@interface MapsAppDelegate : NSObject <UIApplicationDelegate, UIAlertViewDelegate, UINavigationControllerDelegate>
{
SettingsManager * m_settingsManager;
NSInteger m_standbyCounter;
diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm
index c3b5664ff8..93d39dfbf1 100644
--- a/iphone/Maps/Classes/MapsAppDelegate.mm
+++ b/iphone/Maps/Classes/MapsAppDelegate.mm
@@ -156,6 +156,7 @@ void InitLocalizedStrings()
m_navController = [[UINavigationController alloc] initWithRootViewController:m_mapViewController];
m_navController.navigationBarHidden = YES;
+ m_navController.delegate = self;
m_window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
m_window.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
m_window.clearsContextBeforeDrawing = NO;
@@ -195,6 +196,7 @@ void InitLocalizedStrings()
url_scheme::ApiPoint apiPoint;
if (GetFramework().SetViewportByURL([[url.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] UTF8String], apiPoint));
{
+ [[Statistics instance] logEvent:@"ge0(zero) Import"];
[self showMap];
[m_mapViewController prepareForApi];
return YES;
@@ -247,14 +249,19 @@ void InitLocalizedStrings()
[m_navController popToRootViewControllerAnimated:YES];
if (![m_navController.visibleViewController isMemberOfClass:NSClassFromString(@"MapViewController")])
[m_mapViewController dismissModalViewControllerAnimated:YES];
- [m_mapViewController dismissPopoverAndSaveBookmark:YES];
m_navController.navigationBarHidden = YES;
}
--(void) showParsedBookmarkOnMap:(url_api::Request const &) request
+-(void) showParsedBookmarkOnMap:(url_scheme::ApiPoint const &) point
{
[self showMap];
- GetFramework().GetBalloonManager().ShowUrlRequest(request);
+ GetFramework().GetBalloonManager().ShowApiPoint(point);
+}
+
+- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
+{
+ if ([viewController isMemberOfClass:NSClassFromString(@"MapViewController")] && ![m_mapViewController shouldShowNavBar])
+ [m_navController setNavigationBarHidden:YES animated:YES];
}
@end
diff --git a/iphone/Maps/Classes/SearchVC.h b/iphone/Maps/Classes/SearchVC.h
index a2c6fffb37..b0864e5a3a 100644
--- a/iphone/Maps/Classes/SearchVC.h
+++ b/iphone/Maps/Classes/SearchVC.h
@@ -1,14 +1,12 @@
#import <UIKit/UIKit.h>
#import "LocationManager.h"
-#import "SearchSuggestionsCell.h"
-#import "BalloonView.h"
class Framework;
@interface SearchVC : UIViewController
<UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource,
- LocationObserver, SearchSuggestionDelegate>
+ LocationObserver>
{
Framework * m_framework;
LocationManager * m_locationManager;