Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /* Style: A base class from which all other styles are inherited, includes
3 : : * a name.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * For further information visit http://libwpd.sourceforge.net
10 : : */
11 : :
12 : : /* "This product is not manufactured, approved, or supported by
13 : : * Corel Corporation or Corel Corporation Limited."
14 : : */
15 : :
16 : : #ifndef _STYLE_H
17 : : #define _STYLE_H
18 : : #include <libwpd/libwpd.h>
19 : :
20 : : #include "DocumentElement.hxx"
21 : :
22 : : class TopLevelElementStyle
23 : : {
24 : : public:
25 : 0 : TopLevelElementStyle() : mpsMasterPageName(0) {}
26 : 0 : virtual ~TopLevelElementStyle()
27 : 0 : {
28 [ # # ][ # # ]: 0 : if (mpsMasterPageName) delete mpsMasterPageName;
29 [ # # ]: 0 : }
30 : 0 : void setMasterPageName(WPXString &sMasterPageName)
31 : : {
32 [ # # ]: 0 : mpsMasterPageName = new WPXString(sMasterPageName);
33 : 0 : }
34 : 0 : const WPXString *getMasterPageName() const
35 : : {
36 : 0 : return mpsMasterPageName;
37 : : }
38 : :
39 : : private:
40 : : TopLevelElementStyle(const TopLevelElementStyle &);
41 : : TopLevelElementStyle &operator=(const TopLevelElementStyle &);
42 : : WPXString *mpsMasterPageName;
43 : : };
44 : :
45 : : class Style
46 : : {
47 : : public:
48 : 0 : Style(const WPXString &psName) : msName(psName) {}
49 [ # # ]: 0 : virtual ~Style() {}
50 : :
51 : 0 : virtual void write(OdfDocumentHandler *) const {};
52 : 0 : const WPXString &getName() const
53 : : {
54 : 0 : return msName;
55 : : }
56 : :
57 : : private:
58 : : WPXString msName;
59 : : };
60 : :
61 : : class StyleManager
62 : : {
63 : : public:
64 : 0 : StyleManager() {}
65 [ # # ]: 0 : virtual ~StyleManager() {}
66 : :
67 : 0 : virtual void clean() {};
68 : : virtual void write(OdfDocumentHandler *) const = 0;
69 : :
70 : : private:
71 : : // forbide copy constructor/operator
72 : : StyleManager(const StyleManager &);
73 : : StyleManager &operator=(const StyleManager &);
74 : : };
75 : : #endif
76 : :
77 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|