merge the formfield patch from ooo-build
[ooovba.git] / sc / source / filter / inc / excscen.hxx
blobc3ccd9730592709f3259581cbc1f83a293eecc51
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: excscen.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_EXCSCEN_HXX
32 #define SC_EXCSCEN_HXX
34 #include <tools/solar.h>
35 #include <tools/list.hxx>
36 #include <tools/string.hxx>
39 struct RootData;
40 class XclImpRoot;
41 class XclImpStream;
42 class ScDocument;
46 class ExcScenarioCell
48 private:
49 String aValue;
50 public:
51 const UINT16 nCol;
52 const UINT16 nRow;
54 ExcScenarioCell( const UINT16 nC, const UINT16 nR );
55 void SetValue( const String& rVal );
56 inline const String& GetValue( void ) const;
62 class ExcScenario : protected List
64 private:
65 friend class ExcScenarioList;
66 protected:
67 String* pName;
68 String* pComment;
69 String* pUserName;
70 UINT8 nProtected;
72 const UINT16 nTab;
74 void Apply( const XclImpRoot& rRoot, const BOOL bLast = FALSE );
75 public:
76 ExcScenario( XclImpStream& rIn, const RootData& rRoot );
77 virtual ~ExcScenario();
83 class ExcScenarioList : protected List
85 private:
86 UINT16 nLastScenario;
87 inline ExcScenario* _First( void ) { return ( ExcScenario* ) List::First(); }
88 inline ExcScenario* _Next( void ) { return ( ExcScenario* ) List::Next(); }
89 inline ExcScenario* _Last( void ) { return ( ExcScenario* ) List::Last(); }
90 inline ExcScenario* _Prev( void ) { return ( ExcScenario* ) List::Prev(); }
91 protected:
92 public:
93 ExcScenarioList( void );
94 virtual ~ExcScenarioList();
96 inline void Append( ExcScenario* pNew );
98 inline void SetLast( const UINT16 nIndex4Last );
100 inline const ExcScenario* First( void );
101 inline const ExcScenario* Next( void );
103 using List::Count;
105 void Apply( const XclImpRoot& rRoot );
111 inline const String& ExcScenarioCell::GetValue( void ) const
113 return aValue;
119 inline ExcScenarioList::ExcScenarioList( void )
121 nLastScenario = 0;
125 inline void ExcScenarioList::Append( ExcScenario* p )
127 List::Insert( p, LIST_APPEND );
131 inline const ExcScenario* ExcScenarioList::First( void )
133 return ( const ExcScenario* ) List::First();
137 inline const ExcScenario* ExcScenarioList::Next( void )
139 return ( const ExcScenario* ) List::Next();
143 inline void ExcScenarioList::SetLast( const UINT16 n )
145 nLastScenario = n;
149 #endif