view dwt/internal/cocoa/NSCompoundPredicate.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
 *     IBM Corporation - initial API and implementation
 *     
 * Port to the D Programming language:
 *     Jacob Carlborg <jacob.carlborg@gmail.com>
 *******************************************************************************/
module dwt.internal.cocoa.NSCompoundPredicate;

import dwt.internal.cocoa.id;
import dwt.internal.cocoa.NSArray;
import dwt.internal.cocoa.NSPredicate;
import dwt.internal.cocoa.OS;
import objc = dwt.internal.objc.runtime;

public class NSCompoundPredicate : NSPredicate
{

    public this ()
    {
        super();
    }

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

    public static NSPredicate andPredicateWithSubpredicates (NSArray subpredicates)
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCompoundPredicate, OS.sel_andPredicateWithSubpredicates_1,
                subpredicates !is null ? subpredicates.id_ : null);
        return result !is null ? new NSPredicate(result) : null;
    }

    public objc.id compoundPredicateType ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_compoundPredicateType);
    }

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

    public static NSPredicate notPredicateWithSubpredicate (NSPredicate predicate)
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCompoundPredicate, OS.sel_notPredicateWithSubpredicate_1,
                predicate !is null ? predicate.id_ : null);
        return result !is null ? new NSPredicate(result) : null;
    }

    public static NSPredicate orPredicateWithSubpredicates (NSArray subpredicates)
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCompoundPredicate, OS.sel_orPredicateWithSubpredicates_1,
                subpredicates !is null ? subpredicates.id_ : null);
        return result !is null ? new NSPredicate(result) : null;
    }

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

}