The auto complete session successfully instantiates now in response to user input.

This commit is contained in:
hyatt%netscape.com 2002-04-27 09:09:08 +00:00
Родитель 270008c957
Коммит c5a1df608c
13 изменённых файлов: 97 добавлений и 195 удалений

Просмотреть файл

@ -22,9 +22,12 @@
*/
#import <Foundation/Foundation.h>
#include "nsIAutoCompleteSession.h"
@interface CHAutoCompleteDataSource : NSObject {
nsIAutoCompleteSession* mAutoComplete;
}
-(void)initialize;
@end

Просмотреть файл

@ -23,9 +23,29 @@
#import <AppKit/AppKit.h>
#import "CHAutoCompleteDataSource.h"
#include "nsIServiceManager.h"
@implementation CHAutoCompleteDataSource
-(id)init
{
if ((self = [super init])) {
mAutoComplete = nsnull;
}
return self;
}
-(void)initialize
{
if (!mAutoComplete) {
nsCOMPtr<nsIAutoCompleteSession> session =
do_GetService("@mozilla.org/autocompleteSession;1?type=history");
mAutoComplete = session;
if (!mAutoComplete)
printf("CRAP CRAP!\n");
}
}
-(int)numberOfRowsInTableView:(NSTableView*)aTableView
{
return 0;

Просмотреть файл

@ -1,34 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import <AppKit/AppKit.h>
#import "BrowserWindowController.h"
#import "CHAutoCompleteDataSource.h"
@interface CHAutoCompleteTableView : NSTableView {
IBOutlet NSTextField* mURLBar;
IBOutlet BrowserWindowController* mWindowController;
CHAutoCompleteDataSource* mDataSource;
}
@end

Просмотреть файл

@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import "CHAutoCompleteTableView.h"
#import "CHAutoCompleteDataSource.h"
@implementation CHAutoCompleteTableView
-(id)initWithFrame:(NSRect)aRect
{
if ((self = [super initWithFrame: aRect])) {
// Create our data source.
mDataSource = [[CHAutoCompleteDataSource alloc] init];
[self setDataSource: mDataSource];
// Create the URL column.
NSTableColumn* urlColumn = [[[NSTableColumn alloc] initWithIdentifier:@"URL"] autorelease];
[self addTableColumn: urlColumn];
NSTableColumn* titleColumn = [[[NSTableColumn alloc] initWithIdentifier:@"Title"] autorelease];
[self addTableColumn: titleColumn];
}
return self;
}
-(void)dealloc
{
[mDataSource release];
[super dealloc];
}
-(void)controlTextDidChange:(NSNotification*)aNotification
{
// [[[[mWindowController window] contentView] superview] addSubview: self];
}
-(void)controlTextDidEndEditing:(NSNotification*)aNotification
{
printf("Editing finished.\n");
}
@end

Просмотреть файл

@ -257,7 +257,7 @@
buildSettings = {
DEBUGGING_SYMBOLS = NO;
FRAMEWORK_SEARCH_PATHS = ../embedding/browser/cocoa/src/build;
HEADER_SEARCH_PATHS = "../dist/include/webbrwsr ../dist/include/dom ../dist/include/nspr ../dist/include/string ../dist/include/rdf ../dist/include/necko ../dist/include/find ../dist/include/embed_base ../dist/include/windowwatcher ../dist/include/webshell ../dist/include/widget ../dist/include/uriloader ../dist/include/docshell ../dist/include/profile ../dist/include/layout ../dist/include/content ../dist/include/webbrowserpersist ../dist/include/pref ../dist/include/mimetype ../dist/include/shistory ../dist/include/view ../dist/include/gfx ../dist/include/xultmpl ../dist/include/xmlextras ../dist/include/htmlparser ../dist/include/locale ../dist/include/unicharutil ../dist/include/xpcom";
HEADER_SEARCH_PATHS = "../dist/include/webbrwsr ../dist/include/dom ../dist/include/nspr ../dist/include/string ../dist/include/rdf ../dist/include/necko ../dist/include/find ../dist/include/embed_base ../dist/include/windowwatcher ../dist/include/webshell ../dist/include/widget ../dist/include/uriloader ../dist/include/docshell ../dist/include/profile ../dist/include/layout ../dist/include/content ../dist/include/webbrowserpersist ../dist/include/pref ../dist/include/mimetype ../dist/include/shistory ../dist/include/view ../dist/include/gfx ../dist/include/xultmpl ../dist/include/xmlextras ../dist/include/htmlparser ../dist/include/locale ../dist/include/unicharutil ../dist/include/appcomps ../dist/include/xpcom";
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = "../dist/bin ../dist/lib ../intl/unicharutil/util ../modules/zlib/src";
OPTIMIZATION_CFLAGS = "-O2";

Просмотреть файл

@ -22,9 +22,12 @@
*/
#import <Foundation/Foundation.h>
#include "nsIAutoCompleteSession.h"
@interface CHAutoCompleteDataSource : NSObject {
nsIAutoCompleteSession* mAutoComplete;
}
-(void)initialize;
@end

Просмотреть файл

@ -23,9 +23,29 @@
#import <AppKit/AppKit.h>
#import "CHAutoCompleteDataSource.h"
#include "nsIServiceManager.h"
@implementation CHAutoCompleteDataSource
-(id)init
{
if ((self = [super init])) {
mAutoComplete = nsnull;
}
return self;
}
-(void)initialize
{
if (!mAutoComplete) {
nsCOMPtr<nsIAutoCompleteSession> session =
do_GetService("@mozilla.org/autocompleteSession;1?type=history");
mAutoComplete = session;
if (!mAutoComplete)
printf("CRAP CRAP!\n");
}
}
-(int)numberOfRowsInTableView:(NSTableView*)aTableView
{
return 0;

Просмотреть файл

@ -22,9 +22,12 @@
*/
#import <Foundation/Foundation.h>
#include "nsIAutoCompleteSession.h"
@interface CHAutoCompleteDataSource : NSObject {
nsIAutoCompleteSession* mAutoComplete;
}
-(void)initialize;
@end

Просмотреть файл

@ -23,9 +23,29 @@
#import <AppKit/AppKit.h>
#import "CHAutoCompleteDataSource.h"
#include "nsIServiceManager.h"
@implementation CHAutoCompleteDataSource
-(id)init
{
if ((self = [super init])) {
mAutoComplete = nsnull;
}
return self;
}
-(void)initialize
{
if (!mAutoComplete) {
nsCOMPtr<nsIAutoCompleteSession> session =
do_GetService("@mozilla.org/autocompleteSession;1?type=history");
mAutoComplete = session;
if (!mAutoComplete)
printf("CRAP CRAP!\n");
}
}
-(int)numberOfRowsInTableView:(NSTableView*)aTableView
{
return 0;

Просмотреть файл

@ -1,34 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import <AppKit/AppKit.h>
#import "BrowserWindowController.h"
#import "CHAutoCompleteDataSource.h"
@interface CHAutoCompleteTableView : NSTableView {
IBOutlet NSTextField* mURLBar;
IBOutlet BrowserWindowController* mWindowController;
CHAutoCompleteDataSource* mDataSource;
}
@end

Просмотреть файл

@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import "CHAutoCompleteTableView.h"
#import "CHAutoCompleteDataSource.h"
@implementation CHAutoCompleteTableView
-(id)initWithFrame:(NSRect)aRect
{
if ((self = [super initWithFrame: aRect])) {
// Create our data source.
mDataSource = [[CHAutoCompleteDataSource alloc] init];
[self setDataSource: mDataSource];
// Create the URL column.
NSTableColumn* urlColumn = [[[NSTableColumn alloc] initWithIdentifier:@"URL"] autorelease];
[self addTableColumn: urlColumn];
NSTableColumn* titleColumn = [[[NSTableColumn alloc] initWithIdentifier:@"Title"] autorelease];
[self addTableColumn: titleColumn];
}
return self;
}
-(void)dealloc
{
[mDataSource release];
[super dealloc];
}
-(void)controlTextDidChange:(NSNotification*)aNotification
{
// [[[[mWindowController window] contentView] superview] addSubview: self];
}
-(void)controlTextDidEndEditing:(NSNotification*)aNotification
{
printf("Editing finished.\n");
}
@end

Просмотреть файл

@ -22,9 +22,12 @@
*/
#import <Foundation/Foundation.h>
#include "nsIAutoCompleteSession.h"
@interface CHAutoCompleteDataSource : NSObject {
nsIAutoCompleteSession* mAutoComplete;
}
-(void)initialize;
@end

Просмотреть файл

@ -23,9 +23,29 @@
#import <AppKit/AppKit.h>
#import "CHAutoCompleteDataSource.h"
#include "nsIServiceManager.h"
@implementation CHAutoCompleteDataSource
-(id)init
{
if ((self = [super init])) {
mAutoComplete = nsnull;
}
return self;
}
-(void)initialize
{
if (!mAutoComplete) {
nsCOMPtr<nsIAutoCompleteSession> session =
do_GetService("@mozilla.org/autocompleteSession;1?type=history");
mAutoComplete = session;
if (!mAutoComplete)
printf("CRAP CRAP!\n");
}
}
-(int)numberOfRowsInTableView:(NSTableView*)aTableView
{
return 0;