File indexing completed on 2024-04-21 04:47:52

0001 /****************************************************************************************
0002  * Copyright (c) 2008 Nikolaj Hald Nielsen <nhn@kde.org>                                *
0003  * Copyright (c) 2009-2010 Bart Cerneels <bart.cerneels@kde.org>                        *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 
0018 #include "OpmlOutline.h"
0019 
0020 OpmlOutline::OpmlOutline( OpmlOutline *parent )
0021         : m_parent( parent )
0022         , m_hasChildren( false )
0023 {
0024 }
0025 
0026 OpmlNodeType
0027 OpmlOutline::opmlNodeType() const
0028 {
0029     if( !attributes().contains( "text" ) )
0030         return InvalidNode;
0031 
0032     if( !attributes().contains( "type") )
0033         return RegularNode;
0034 
0035     if( attributes()["type"] == "rss" )
0036         return RssUrlNode;
0037 
0038     if( attributes()["type"] == "include" )
0039         return IncludeNode;
0040 
0041     return UnknownNode;
0042 
0043 }