sw floattable: handle AllowOverlap==false in the layout
[LibreOffice.git] / idl / inc / basobj.hxx
blob2bdd8e622e44de1a3d98771c9714224e8a19e8cd
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_IDL_INC_BASOBJ_HXX
21 #define INCLUDED_IDL_INC_BASOBJ_HXX
23 #include <tools/ref.hxx>
24 #include "bastype.hxx"
25 #include <vector>
27 class SvTokenStream;
28 class SvIdlDataBase;
30 template<typename T>
31 class SvRefMemberList : private std::vector<T>
33 private:
34 typedef typename std::vector<T> base_t;
36 public:
37 using base_t::size;
38 using base_t::front;
39 using base_t::back;
40 using base_t::operator[];
41 using base_t::begin;
42 using base_t::end;
43 using typename base_t::iterator;
44 using typename base_t::const_iterator;
45 using base_t::rbegin;
46 using base_t::rend;
47 using typename base_t::reverse_iterator;
48 using base_t::empty;
50 ~SvRefMemberList() { clear(); }
51 void clear()
53 for( typename base_t::const_iterator it = base_t::begin(); it != base_t::end(); ++it )
55 T p = *it;
56 if( p )
57 p->ReleaseRef();
59 base_t::clear();
62 void push_back( T p )
64 base_t::push_back( p );
65 p->AddFirstRef();
68 void insert( typename base_t::iterator it, T p )
70 base_t::insert( it, p );
71 p->AddFirstRef();
74 void pop_back()
76 T p = base_t::back();
77 base_t::pop_back();
78 if( p )
79 p->ReleaseRef();
83 class SvMetaObject : public SvRefBase
85 OString aName;
87 protected:
88 bool ReadNameSvIdl( SvTokenStream & rInStm );
89 void DoReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
90 virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
91 virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
92 SvTokenStream & rInStm );
93 public:
94 SvMetaObject();
96 static void WriteTab( SvStream & rOutStm, sal_uInt16 nTab );
97 static void Back2Delimiter( SvStream & );
98 static void WriteStars( SvStream & );
100 void SetName( const OString& rName );
101 virtual const OString & GetName() const { return aName; }
103 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
106 class SvMetaReference : public SvMetaObject
108 tools::SvRef<SvMetaReference> aRef;
109 public:
110 SvMetaReference();
112 const OString & GetName() const override
114 return ( !aRef.is()
115 || !SvMetaObject::GetName().isEmpty() )
116 ? SvMetaObject::GetName()
117 : aRef->GetName();
120 SvMetaReference * GetRef() const { return aRef.get(); }
121 void SetRef( SvMetaReference * pRef )
122 { aRef = pRef; }
125 #endif // INCLUDED_IDL_INC_BASOBJ_HXX
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */