/* ***** 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 ***** */

// ISciMozEvents.idl
// Event interface from the Scintilla Mozilla plugin.
// Author: Neil Hodgson

#include "nsISupports.idl"

[scriptable, uuid(1b7577c0-ba94-42b6-879d-c4783b9e3c78)]
interface ISciMozEvents : nsISupports {
    // XXX several events are commented out because we don't
    // actually use them in komodo.  If we end up needing to
    // use them, we will need to split into two or more
    // ISci*Events interfaces.  Note that usage of these items
    // is also commented out in nsSciMoz.cxx
    
    const long SME_STYLENEEDED       = (1 << 0);
    const long SME_CHARADDED         = (1 << 1);
    const long SME_SAVEPOINTREACHED  = (1 << 2);
    const long SME_SAVEPOINTLEFT     = (1 << 3);
    const long SME_MODIFYATTEMPTRO   = (1 << 4);
    const long SME_KEY               = (1 << 5);
    const long SME_DOUBLECLICK       = (1 << 6);
    const long SME_UPDATEUI          = (1 << 7);
    const long SME_MODIFIED          = (1 << 8);
    const long SME_MACRORECORD       = (1 << 9);
    const long SME_MARGINCLICK       = (1 << 10);
    const long SME_NEEDSHOWN         = (1 << 11);
    // const long SME_UNUSED1        = (1 << 12);
    const long SME_PAINTED           = (1 << 13);
    const long SME_USERLISTSELECTION = (1 << 14);
    const long SME_URIDROPPED        = (1 << 15);
    const long SME_DWELLSTART        = (1 << 16);
    const long SME_DWELLEND          = (1 << 17);
    const long SME_ZOOM              = (1 << 18);
    const long SME_HOTSPOTCLICK      = (1 << 19);
    const long SME_HOTSPOTDOUBLECLICK= (1 << 20);
    const long SME_CALLTIPCLICK      = (1 << 21);
    const long SME_AUTOCSELECTION    = (1 << 22);
    const long SME_INDICATORCLICK    = (1 << 23);
    const long SME_INDICATORRELEASE  = (1 << 24);
    const long SME_AUTOCCANCELLED    = (1 << 25);
    const long SME_AUTOCCHARDELETED  = (1 << 26);
    // Komodo specific
    const long SME_COMMANDUPDATE     = (1 << 27);

    const long SME_ALL               = (1 << 28) - 1;

    // void onStyleNeeded(in long position);
    void onCharAdded(in long ch);
    void onSavePointReached();
    void onSavePointLeft();
    // void onModifyAttemptRO();
    // onKey is specific to the GTK+ version
    // void onKey(in long ch, in long modifiers);
    void onDoubleClick();
    void onUpdateUI(in long updated,
                    in long horizScrollPageIncrement);
    void onModified(in long position, in long modificationType,
                    in AString text, in uint32_t length,
                    in long linesAdded, in long line,
                    in long foldLevelNow, in long foldLevelPrev);
    // void onMacroRecord(in long message, in long wParam, in long lParam);
    void onMarginClick(in long modifiers, in long position, in long margin);
    // void onNeedShown(in long position, in long length);
    void onZoom();
    void onHotSpotDoubleClick(in long position, in long modifiers);
    // void onPainted();
    void onDwellStart(in long position, in long x, in long y);
    void onDwellEnd(in long position, in long x, in long y);

    // Komodo additions
    void onCommandUpdate(in string commandset);
    // Any other events (like SME_AUTOCSELECTION, SME_INDICATORCLICK, etc...).
    // Note: Not all fields will be useful for all events, some will be NULL or
    //       0 if they are unused - consult the Scintilla docs for details.
    void onOtherNotification(in long notificationType, in long position,
                             in AString text, in long modifiers);

};
