fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / svx / workben / msview / xmlconfig.hxx
blobb9696023cf2837089a1b24750f24834995c39ceb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_WORKBEN_MSVIEW_XMLCONFIG_HXX
21 #define INCLUDED_SVX_WORKBEN_MSVIEW_XMLCONFIG_HXX
23 #include <map>
24 #include <list>
25 #include <boost/shared_ptr.hpp>
29 enum ElementConfigType { ECT_HEXDUMP, ECT_BYTE, ECT_UINT, ECT_UNISTRING, ETC_FLOAT, ETC_CONTAINER };
31 class ElementConfig
33 public:
34 ElementConfig() : mnType( ECT_HEXDUMP ) {}
35 ElementConfig( const OUString& rName, ElementConfigType rType ) : maName( rName ), mnType( rType ) {}
36 ElementConfig( const OUString& rName ) : maName( rName ) {}
37 ElementConfig( ElementConfigType rType ) : mnType( rType ) {}
39 virtual OUString format( SvStream& rStream, sal_Size& nLength ) const;
41 const OUString& getName() const { return maName; }
42 ElementConfigType getType() const { return mnType; }
44 static OUString dump_hex( SvStream& rStream, sal_Size& nLength );
45 static OUString dump_byte( SvStream& rStream, sal_Size& nLength );
46 static OUString dump_uint( SvStream& rStream, sal_Size& nLength );
47 static OUString dump_unistring( SvStream& rStream, sal_Size& nLength );
48 static OUString dump_float( SvStream& rStream, sal_Size& nLength );
49 private:
50 OUString maName;
51 ElementConfigType mnType;
53 typedef boost::shared_ptr< ElementConfig > ElementConfigPtr;
54 typedef std::list< ElementConfigPtr > ElementConfigList;
58 class ElementValueConfig : public ElementConfig
60 public:
61 ElementValueConfig( const OUString& rName, const OUString& rValue ) : ElementConfig( rName ), maValue( rValue ) {}
63 const OUString& getValue() const { return maValue; }
65 private:
66 OUString maValue;
71 class ElementConfigContainer : public ElementConfig
73 public:
74 ElementConfigContainer() : ElementConfig( ETC_CONTAINER ) {}
75 ElementConfigContainer( const OUString& rName, ElementConfigType rType ) : ElementConfig( rName, rType ) {}
76 ElementConfigContainer( const OUString& rName ) : ElementConfig( rName, ETC_CONTAINER ) {}
77 ElementConfigContainer( ElementConfigType rType ) : ElementConfig( rType ) {}
79 virtual OUString format( SvStream& rStream, sal_Size& nLength ) const;
81 void addElementConfig( ElementConfigPtr p ) { maElementConfigList.push_back( p ); }
83 protected:
84 ElementConfigList maElementConfigList;
89 class CaseElementConfig : public ElementConfigContainer
91 public:
92 CaseElementConfig( const OUString& rValue ) : maValue( rValue ) {}
94 const OUString& getValue() const { return maValue; }
96 private:
97 OUString maValue;
102 class SwitchElementConfig : public ElementConfigContainer
104 public:
105 SwitchElementConfig( ElementConfigType rType ) : ElementConfigContainer( rType ) {}
107 virtual OUString format( SvStream& rStream, sal_Size& nLength ) const;
112 class AtomConfig : public ElementConfigContainer
114 public:
115 AtomConfig( const OUString& rName, bool bIsContainer ) : ElementConfigContainer( rName ), mbIsContainer( bIsContainer ) {}
117 bool isContainer() const { return mbIsContainer; }
119 protected:
120 bool mbIsContainer;
123 typedef std::map< UINT16, ElementConfigPtr > AtomConfigMap;
125 extern AtomConfigMap gAtomConfigMap;
127 #endif
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */