Developer Area

Show
Ignore:
Timestamp:
01/09/10 12:45:03 (5 years ago)
Author:
henri
Message:

First commit of the complete refactoring of keyword management.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/my.tel/trunk/Classes/KeywordEditController.h

    r593 r622  
    88 
    99#import <UIKit/UIKit.h> 
    10 #import <QuartzCore/QuartzCore.h> 
    1110#import "MyTelConnect.h" 
    1211#import "Keyword.h" 
    13 #import "aKeywordView.h" 
    14 #import "baKeywordView.h" 
    15 #import "nKeywordView.h" 
    16 #import "ftKeywordView.h" 
    17 #import "hiKeywordView.h" 
    18 #import "diKeywordView.h" 
    19 #import "biKeywordView.h" 
     12#import "HATextViewEditController.h" 
     13 
     14enum kKKeywordEditTableViewSections { 
     15        kKKeywordEditTableViewSectionType,                      // Primary type 
     16        kKKeywordEditTableViewSectionValue,                     // Primary value 
     17        kKKeywordEditTableViewSectionSecondaries,       // Array of secondaries 
     18        kKKeywordEditTableViewSectionsCount                     // Keep this last to get the count of sections 
     19}; 
    2020 
    2121@protocol KeywordEditDelegate <TelControllerDelegate> 
    22  
    23 - (void)didStoreKeyword:(NSDictionary *)aRec; 
    24 - (NSDictionary *)delegateKeywordTypes; 
    25  
     22@required 
     23- (NSString *)longNameForKeyword:(NSString *)shortName; 
     24- (NSArray *)typesForKeyword:(NSString *)shortName; 
    2625@end 
    2726 
     27#define kKPrimaryValueMaxLength 255             // max length of value when keyword has secondaries 
     28#define kKValueMaxLength        255                     // max length of value when keyword doesn't have secondaries 
    2829 
    29 @interface KeywordEditController : UIViewController <UITextFieldDelegate, UITextViewDelegate> { 
    30         IBOutlet UIBarButtonItem *barHeader; 
    31         IBOutlet UIBarButtonItem *barButtonSave; 
    32         IBOutlet UISegmentedControl *primaryKeywords; 
    33         IBOutlet UITextField *rValue; 
    34         IBOutlet UIActivityIndicatorView *saveIndicator; 
     30 
     31@interface KeywordEditController : UITableViewController <UITableViewDelegate, 
     32UITableViewDataSource, 
     33HATextViewEditDelegate> { 
    3534         
    36         IBOutlet UILabel *editKeywordType;              // title for keyword being edited 
    37         IBOutlet UITextView *secondariesDescription;    // description string for secondaries (no editing) 
    38         IBOutlet UIScrollView *secViewContainer;                // view containing the secondary view 
    39         IBOutlet UIView *editSubview;   // Subview with editing fields 
    40          
     35        NSString *keywordId; 
     36        NSString *primaryType; 
     37        NSString *primaryValue; 
     38        NSMutableArray *secondaryKeywords; 
    4139        id <KeywordEditDelegate> delegate; 
    4240@private 
    4341        NSMutableArray *tArrKey; 
    4442        NSMutableArray *tArrVal; 
    45         NSMutableDictionary *theKeyword; 
    46         NSArray *arraySecondaryViews; 
    47         AbstractKeywordView *currentSecondaryView; 
    48         // Below for keyboard notification 
    49         UIView *activeField; 
    50         BOOL keyboardShown; 
     43        UIBarButtonItem *buttonSave; 
     44        BOOL isEditing; 
    5145} 
    5246 
    53 - (void)presentViewForRecord:(NSDictionary *)aRec; 
    54 - (void)displaySecondaryViewAtIndex:(NSInteger)idx; 
    55 - (IBAction)keywordTypeDidChange:(UISegmentedControl *)sender; 
    56 - (IBAction)didClickCancel:(id)sender; 
    57 - (IBAction)didClickSave:(id)sender; 
     47+ (KeywordEditController *)controllerForKeyword:(NSDictionary *)aRec; 
     48- (KeywordEditController *)initWithKeyword:(NSDictionary *)aRec; 
     49- (void)didClickCancel; 
     50- (void)didClickSave; 
     51- (NSMutableArray *)fillSecondaryKeywords:(NSArray *)secArray; 
    5852 
    59 @property (nonatomic, retain) IBOutlet UIBarButtonItem *barHeader; 
    60 @property (nonatomic, retain) IBOutlet UIBarButtonItem *barButtonSave; 
    61 @property (nonatomic, retain) IBOutlet UISegmentedControl *primaryKeywords; 
    62 @property (nonatomic, retain) IBOutlet UITextField *rValue; 
    63 @property (nonatomic, retain) IBOutlet UILabel *editKeywordType; 
    64 @property (nonatomic, retain) IBOutlet UITextView *secondariesDescription; 
    65 @property (nonatomic, retain) IBOutlet UIScrollView *secViewContainer; 
    66 @property (nonatomic, retain) IBOutlet UIView *editSubview; 
    67 @property (nonatomic, retain) IBOutlet UIActivityIndicatorView *saveIndicator; 
    68 @property (retain) id delegate; 
     53@property (nonatomic, retain) NSString *keywordId; 
     54@property (nonatomic, retain) NSString *primaryType; 
     55@property (nonatomic, retain) NSString *primaryValue; 
     56@property (nonatomic, retain) NSMutableArray *secondaryKeywords; 
     57@property (retain) id <KeywordEditDelegate> delegate; 
     58@property (nonatomic, readonly) BOOL keywordHasSecondaries; 
    6959 
    7060@end 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us