merged tag ooo/OOO330_m14
[LibreOffice.git] / sc / source / filter / inc / excscen.hxx
blob125f74e9fa547df2a93def25c2e862c6a4e76383
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SC_EXCSCEN_HXX
29 #define SC_EXCSCEN_HXX
31 #include <tools/solar.h>
32 #include <tools/list.hxx>
33 #include <tools/string.hxx>
36 struct RootData;
37 class XclImpRoot;
38 class XclImpStream;
39 class ScDocument;
43 class ExcScenarioCell
45 private:
46 String aValue;
47 public:
48 const UINT16 nCol;
49 const UINT16 nRow;
51 ExcScenarioCell( const UINT16 nC, const UINT16 nR );
52 void SetValue( const String& rVal );
53 inline const String& GetValue( void ) const;
59 class ExcScenario : protected List
61 private:
62 friend class ExcScenarioList;
63 protected:
64 String* pName;
65 String* pComment;
66 String* pUserName;
67 UINT8 nProtected;
69 const UINT16 nTab;
71 void Apply( const XclImpRoot& rRoot, const BOOL bLast = FALSE );
72 public:
73 ExcScenario( XclImpStream& rIn, const RootData& rRoot );
74 virtual ~ExcScenario();
80 class ExcScenarioList : protected List
82 private:
83 UINT16 nLastScenario;
84 inline ExcScenario* _First( void ) { return ( ExcScenario* ) List::First(); }
85 inline ExcScenario* _Next( void ) { return ( ExcScenario* ) List::Next(); }
86 inline ExcScenario* _Last( void ) { return ( ExcScenario* ) List::Last(); }
87 inline ExcScenario* _Prev( void ) { return ( ExcScenario* ) List::Prev(); }
88 protected:
89 public:
90 ExcScenarioList( void );
91 virtual ~ExcScenarioList();
93 inline void Append( ExcScenario* pNew );
95 inline void SetLast( const UINT16 nIndex4Last );
97 inline const ExcScenario* First( void );
98 inline const ExcScenario* Next( void );
100 using List::Count;
102 void Apply( const XclImpRoot& rRoot );
108 inline const String& ExcScenarioCell::GetValue( void ) const
110 return aValue;
116 inline ExcScenarioList::ExcScenarioList( void )
118 nLastScenario = 0;
122 inline void ExcScenarioList::Append( ExcScenario* p )
124 List::Insert( p, LIST_APPEND );
128 inline const ExcScenario* ExcScenarioList::First( void )
130 return ( const ExcScenario* ) List::First();
134 inline const ExcScenario* ExcScenarioList::Next( void )
136 return ( const ExcScenario* ) List::Next();
140 inline void ExcScenarioList::SetLast( const UINT16 n )
142 nLastScenario = n;
146 #endif