1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
21 * @file KwCssStyleSheet.cpp
22 * @brief Cascading style sheet.
23 * @author James Hogan <james@albanarts.com>
26 #include "KwCssStyleSheet.h"
27 #include "KwCssStyleRule.h"
32 * Constructors + destructors
35 /// Default constructor.
36 KwCssStyleSheet::KwCssStyleSheet()
43 * This copies all except the actual styles in each rule which are aliased.
45 KwCssStyleSheet::KwCssStyleSheet(const KwCssStyleSheet
& copy
)
49 assert(0&&"unimplemented");
53 KwCssStyleSheet::~KwCssStyleSheet()
62 void KwCssStyleSheet::clear()
68 void KwCssStyleSheet::addRule(const KwCssStyleRule
& rule
)
70 m_rules
.push_back(rule
);
73 /// Import another stylesheet.
74 void KwCssStyleSheet::importStyleSheet(const KwCssStyleSheet
* styleSheet
)
76 m_rules
+= styleSheet
->m_rules
;
84 KwCssStyleSheet::RuleList
& KwCssStyleSheet::getRules()
89 /// Get the constant rules.
90 const KwCssStyleSheet::RuleList
& KwCssStyleSheet::getRules() const
95 /// Convert to CSS-like format.
96 QString
KwCssStyleSheet::toString() const
98 return "/* KwCssStyleSheet::toString() unimplemented */";