/*
 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

module core {

    interface [
        GenerateConstructor,
        InterfaceUUID=149159F4-D2BA-4040-8137-6BF6424C972A,
        ImplementationUUID=E2095280-B9BD-446a-8C03-79F78417CDFF
    ] CharacterData : Node {

        attribute [ConvertNullToNullString] DOMString data
            setter raises(DOMException);

        readonly attribute unsigned long length;
        
        [ConvertNullStringTo=Null, OldStyleObjC] DOMString substringData(in [IsIndex] unsigned long offset, 
                                                           in [IsIndex] unsigned long length)
            raises(DOMException);

        void appendData(in DOMString data)
            raises(DOMException);

        [OldStyleObjC] void insertData(in [IsIndex] unsigned long offset, 
                        in DOMString data)
            raises(DOMException);

        [OldStyleObjC] void deleteData(in [IsIndex] unsigned long offset, 
                        in [IsIndex] unsigned long length)
            raises(DOMException);

        [OldStyleObjC] void replaceData(in [IsIndex] unsigned long offset, 
                         in [IsIndex] unsigned long length,
                         in DOMString data)
            raises(DOMException);
    
    };

}
