diff dwt/internal/cocoa/NSMetadataQuery.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSMetadataQuery.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * 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.NSMetadataQuery;
+
+import dwt.internal.cocoa.id;
+import dwt.internal.cocoa.NSArray;
+import dwt.internal.cocoa.NSDate : NSTimeInterval;
+import dwt.internal.cocoa.NSDictionary;
+import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSObject;
+import dwt.internal.cocoa.NSPredicate;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSMetadataQuery : NSObject
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public id delegatee ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate);
+        return result !is null ? new id(result) : null;
+    }
+
+    public void disableUpdates ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_disableUpdates);
+    }
+
+    public void enableUpdates ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_enableUpdates);
+    }
+
+    public NSArray groupedResults ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_groupedResults);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSArray groupingAttributes ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_groupingAttributes);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSUInteger indexOfResult (id result)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_indexOfResult_1, result !is null ? result.id : null);
+    }
+
+    public bool isGathering ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isGathering) !is null;
+    }
+
+    public bool isStarted ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isStarted) !is null;
+    }
+
+    public bool isStopped ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isStopped) !is null;
+    }
+
+    public NSTimeInterval notificationBatchingInterval ()
+    {
+        return OS.objc_msgSend_fpret(this.id, OS.sel_notificationBatchingInterval);
+    }
+
+    public NSPredicate predicate ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_predicate);
+        return result !is null ? new NSPredicate(result) : null;
+    }
+
+    public id resultAtIndex (NSUInteger idx)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_resultAtIndex_1, idx);
+        return result !is null ? new id(result) : null;
+    }
+
+    public objc.id resultCount ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_resultCount);
+    }
+
+    public NSArray results ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_results);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSArray searchScopes ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_searchScopes);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public void setDelegate (id delegatee)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null);
+    }
+
+    public void setGroupingAttributes (NSArray attrs)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setGroupingAttributes_1, attrs !is null ? attrs.id : null);
+    }
+
+    public void setNotificationBatchingInterval (NSTimeInterval ti)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setNotificationBatchingInterval_1, ti);
+    }
+
+    public void setPredicate (NSPredicate predicate)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPredicate_1, predicate !is null ? predicate.id : null);
+    }
+
+    public void setSearchScopes (NSArray scopes)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setSearchScopes_1, scopes !is null ? scopes.id : null);
+    }
+
+    public void setSortDescriptors (NSArray descriptors)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setSortDescriptors_1, descriptors !is null ? descriptors.id : null);
+    }
+
+    public void setValueListAttributes (NSArray attrs)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setValueListAttributes_1, attrs !is null ? attrs.id : null);
+    }
+
+    public NSArray sortDescriptors ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_sortDescriptors);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public bool startQuery ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_startQuery) !is null;
+    }
+
+    public void stopQuery ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_stopQuery);
+    }
+
+    public NSArray valueListAttributes ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_valueListAttributes);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSDictionary valueLists ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_valueLists);
+        return result !is null ? new NSDictionary(result) : null;
+    }
+
+    public id valueOfAttribute (NSString attrName, NSUInteger idx)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_valueOfAttribute_1forResultAtIndex_1, attrName !is null ? attrName.id : null, idx);
+        return result !is null ? new id(result) : null;
+    }
+
+}