view dwt/internal/cocoa/NSSearchFieldCell.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     
 * Port to the D Programming language:
 *     Jacob Carlborg <jacob.carlborg@gmail.com>
 *******************************************************************************/
module dwt.internal.cocoa.NSSearchFieldCell;

import dwt.internal.cocoa.NSArray;
import dwt.internal.cocoa.NSButtonCell;
import dwt.internal.cocoa.NSInteger;
import dwt.internal.cocoa.NSMenu;
import dwt.internal.cocoa.NSRect;
import dwt.internal.cocoa.NSString;
import dwt.internal.cocoa.NSTextFieldCell;
import dwt.internal.cocoa.OS;
import objc = dwt.internal.objc.runtime;

public class NSSearchFieldCell : NSTextFieldCell
{

    public this ()
    {
        super();
    }

    public this (objc.id id)
    {
        super(id);
    }

    public NSButtonCell cancelButtonCell ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_cancelButtonCell);
        return result !is null ? new NSButtonCell(result) : null;
    }

    public NSRect cancelButtonRectForBounds (NSRect rect)
    {
        NSRect result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_cancelButtonRectForBounds_1, rect);
        return result;
    }

    public NSInteger maximumRecents ()
    {
        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_maximumRecents);
    }

    public NSArray recentSearches ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_recentSearches);
        return result !is null ? new NSArray(result) : null;
    }

    public NSString recentsAutosaveName ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_recentsAutosaveName);
        return result !is null ? new NSString(result) : null;
    }

    public void resetCancelButtonCell ()
    {
        OS.objc_msgSend(this.id_, OS.sel_resetCancelButtonCell);
    }

    public void resetSearchButtonCell ()
    {
        OS.objc_msgSend(this.id_, OS.sel_resetSearchButtonCell);
    }

    public NSButtonCell searchButtonCell ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_searchButtonCell);
        return result !is null ? new NSButtonCell(result) : null;
    }

    public NSRect searchButtonRectForBounds (NSRect rect)
    {
        NSRect result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_searchButtonRectForBounds_1, rect);
        return result;
    }

    public NSMenu searchMenuTemplate ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_searchMenuTemplate);
        return result !is null ? new NSMenu(result) : null;
    }

    public NSRect searchTextRectForBounds (NSRect rect)
    {
        NSRect result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_searchTextRectForBounds_1, rect);
        return result;
    }

    public bool sendsSearchStringImmediately ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_sendsSearchStringImmediately) !is null;
    }

    public bool sendsWholeSearchString ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_sendsWholeSearchString) !is null;
    }

    public void setCancelButtonCell (NSButtonCell cell)
    {
        OS.objc_msgSend(this.id_, OS.sel_setCancelButtonCell_1, cell !is null ? cell.id_ : null);
    }

    public void setMaximumRecents (NSInteger maxRecents)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMaximumRecents_1, maxRecents);
    }

    public void setRecentSearches (NSArray searches)
    {
        OS.objc_msgSend(this.id_, OS.sel_setRecentSearches_1, searches !is null ? searches.id_ : null);
    }

    public void setRecentsAutosaveName (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setRecentsAutosaveName_1, string !is null ? string.id_ : null);
    }

    public void setSearchButtonCell (NSButtonCell cell)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSearchButtonCell_1, cell !is null ? cell.id_ : null);
    }

    public void setSearchMenuTemplate (NSMenu menu)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSearchMenuTemplate_1, menu !is null ? menu.id_ : null);
    }

    public void setSendsSearchStringImmediately (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSendsSearchStringImmediately_1, flag);
    }

    public void setSendsWholeSearchString (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSendsWholeSearchString_1, flag);
    }

}