view dwt/internal/cocoa/NSCharacterSet.d @ 13:f565d3a95c0a

Ported dwt.internal
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 22 Aug 2008 16:46:34 +0200
parents 8b48be5454ce
children d8635bb48c7c
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.NSCharacterSet;

import dwt.internal.cocoa.id;
import dwt.internal.cocoa.NSData;
import dwt.internal.cocoa.NSObject;
import dwt.internal.cocoa.NSRange;
import dwt.internal.cocoa.NSString;
import dwt.internal.cocoa.OS;
import objc = dwt.internal.objc.runtime;

public class NSCharacterSet : NSObject
{

    public this ()
    {
        super();
    }

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

    public static id alphanumericCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_alphanumericCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public NSData bitmapRepresentation ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_bitmapRepresentation);
        return result !is null ? new NSData(result) : null;
    }

    public static id capitalizedLetterCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_capitalizedLetterCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public bool characterIsMember (short aCharacter)
    {
        return OS.objc_msgSend(this.id_, OS.sel_characterIsMember_1, aCharacter) !is null;
    }

    public static id characterSetWithBitmapRepresentation (NSData data)
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithBitmapRepresentation_1, data !is null ? data.id_ : null);
        return result !is null ? new id(result) : null;
    }

    public static id characterSetWithCharactersInString (NSString aString)
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithCharactersInString_1, aString !is null ? aString.id_ : null);
        return result !is null ? new id(result) : null;
    }

    public static id characterSetWithContentsOfFile (NSString fName)
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithContentsOfFile_1, fName !is null ? fName.id_ : null);
        return result !is null ? new id(result) : null;
    }

    public static id characterSetWithRange (NSRange aRange)
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithRange_1, aRange);
        return result !is null ? new id(result) : null;
    }

    public static id controlCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_controlCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id decimalDigitCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_decimalDigitCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id decomposableCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_decomposableCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public bool hasMemberInPlane (byte thePlane)
    {
        return OS.objc_msgSend(this.id_, OS.sel_hasMemberInPlane_1, thePlane) !is null;
    }

    public static id illegalCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_illegalCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public NSCharacterSet invertedSet ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_invertedSet);
        return result is this.id_ ? this : (result !is null ? new NSCharacterSet(result) : null);
    }

    public bool isSupersetOfSet (NSCharacterSet theOtherSet)
    {
        return OS.objc_msgSend(this.id_, OS.sel_isSupersetOfSet_1, theOtherSet !is null ? theOtherSet.id_ : null) !is null;
    }

    public static id letterCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_letterCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public bool longCharacterIsMember (dchar theLongChar)
    {
        return OS.objc_msgSend(this.id_, OS.sel_longCharacterIsMember_1, theLongChar) !is null;
    }

    public static id lowercaseLetterCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_lowercaseLetterCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id newlineCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_newlineCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id nonBaseCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_nonBaseCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id punctuationCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_punctuationCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id symbolCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_symbolCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id uppercaseLetterCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_uppercaseLetterCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id whitespaceAndNewlineCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_whitespaceAndNewlineCharacterSet);
        return result !is null ? new id(result) : null;
    }

    public static id whitespaceCharacterSet ()
    {
        objc.id result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_whitespaceCharacterSet);
        return result !is null ? new id(result) : null;
    }

}