File indexing completed on 2024-05-05 16:10:29

0001 /* This file is part of the KDE project
0002  *
0003  * Copyright (C) 2004 Leo Savernik <l.savernik@aon.at>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0018  * Boston, MA 02111-1307, USA.
0019  */
0020 
0021 #ifndef KHTML_PARTACCESSOR_H
0022 #define KHTML_PARTACCESSOR_H
0023 
0024 #include "khtml_part.h"
0025 
0026 namespace khtml
0027 {
0028 
0029 /**
0030  * This class is merely a namespace for static accessor methods to private
0031  * methods of KHTMLPart.
0032  *
0033  * As this class is a friend of KHTMLPart, and every method of this class is
0034  * public, it can be used to invoke methods of KHTMLPart that otherwise would
0035  * be private to functions that cannot be declared friends to KHTMLPart
0036  * (i. e. functions that belong to anonymous namespaces)
0037  * @author Leo Savernik
0038  * @internal
0039  */
0040 class KHTMLPartAccessor
0041 {
0042     KHTMLPartAccessor();
0043     ~KHTMLPartAccessor();
0044 public:
0045 
0046     inline static DOM::DocumentImpl *xmlDocImpl(const KHTMLPart *part)
0047     {
0048         return part->xmlDocImpl();
0049     }
0050     inline static const DOM::Selection &caret(const KHTMLPart *part)
0051     {
0052         return part->caret();
0053     }
0054     inline static void clearSelection(KHTMLPart *part)
0055     {
0056         part->clearSelection();
0057     }
0058 
0059     inline static KHTMLPartPrivate *d(const KHTMLPart *part)
0060     {
0061         return part->d;
0062     }
0063 };
0064 
0065 }/*namespace khtml*/
0066 
0067 #endif // KHTML_PARTACCESSOR_H