/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 * 
 * 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 Komodo code.
 * 
 * The Initial Developer of the Original Code is ActiveState Software Inc.
 * Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
 * ActiveState Software Inc. All Rights Reserved.
 * 
 * Contributor(s):
 *   ActiveState Software Inc
 * 
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 * 
 * ***** END LICENSE BLOCK ***** */

// Support for Find in Files' "Browse for dirs" dialog.

#include "nsISupports.idl"
#include "nsITreeView.idl"


[scriptable, uuid(B26C69D5-167A-4912-A71E-C170BF46D7F9)]
interface koIFindAvailableDirsView : nsITreeView {
    // An tree view for the "Available directories" tree in "Find in Files'"
    // "Browse for dirs" dialog.
    
    // Change the view to the given dir.
    //
    //  "currentDir" is an absolute or relative (to the currentDir setting)
    //      path to which to change. It is an error to pass in a relative
    //      path if the current dir has never been set (in which case
    //      an exception is raised).
    //
    // If a non-existant dir is set no error is raised.
    void changeDir(in wstring newDir);
    readonly attribute wstring currentDir;
    
    // Return the full path to the currently selected dir.
    //
    // This is the dir at the nsITreeSelection's currentIndex. There may
    // be multiple items selected -- in which case you will need to use
    // getDirAt(). Raises an exception if there is nothing selected.
    wstring getSelectedDir();
    wstring getDirAt(in unsigned long index);

    // Return the index of the item with the given basename. If no such
    // basename exists return -1.
    long getIndexOfDir(in wstring baseName);
};

[scriptable, uuid(0AA90BAC-D577-4D40-AEE1-FDA46A6AFC2E)]
interface koIFindSelectedDirsView : nsITreeView {
    // An tree view for the "Selected directories" tree in "Find in Files'"
    // "Browse for dirs" dialog.
    void setEncodedFolders(in wstring encodedFolders);
    wstring getEncodedFolders();
    
    // Raises an error iff the dir is already one of the existing folders.
    void addDir(in wstring dir);
    
    void removeSelectedDirs();
    void moveSelectedDirUp();
    void moveSelectedDirDown();
};

