Some DOM code in place for export of style scopes, but without CSS translation
[kworship.git] / kworship / css / KwCssStyleSheet.cpp
blob2f1e18a85d3bd9b2d46077282496179214750b8d
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
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. *
9 * *
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. *
14 * *
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 ***************************************************************************/
20 /**
21 * @file KwCssStyleSheet.cpp
22 * @brief Cascading style sheet.
23 * @author James Hogan <james@albanarts.com>
26 #include "KwCssStyleSheet.h"
27 #include "KwCssStyleRule.h"
29 #include <cassert>
32 * Constructors + destructors
35 /// Default constructor.
36 KwCssStyleSheet::KwCssStyleSheet()
37 : m_rules()
41 /// Copy constructor.
42 /**
43 * This copies all except the actual styles in each rule which are aliased.
45 KwCssStyleSheet::KwCssStyleSheet(const KwCssStyleSheet& copy)
46 : m_rules()
48 /// @todo Copy rules
49 assert(0&&"unimplemented");
52 /// Destructor.
53 KwCssStyleSheet::~KwCssStyleSheet()
58 * Main interface
61 /// Clear the rules.
62 void KwCssStyleSheet::clear()
64 m_rules.clear();
67 /// Append a rule.
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;
80 * Accessors
83 /// Get the rules.
84 KwCssStyleSheet::RuleList& KwCssStyleSheet::getRules()
86 return m_rules;
89 /// Get the constant rules.
90 const KwCssStyleSheet::RuleList& KwCssStyleSheet::getRules() const
92 return m_rules;
95 /// Convert to CSS-like format.
96 QString KwCssStyleSheet::toString() const
98 return "/* KwCssStyleSheet::toString() unimplemented */";