Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / ryzom / tools / leveldesign / georges_convert / item.h
blob8b461bd62e7e1eabb5eb0140e83fb5fc93aaad74
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef NLGEORGES_ITEM_H
18 #define NLGEORGES_ITEM_H
20 #include "string_ex.h"
21 #include "form.h"
23 namespace NLOLDGEORGES
26 class CLoader;
27 class CItemElt;
28 class CItemEltAtom;
29 class CItemEltStruct;
30 class CItemEltList;
32 class CItem
34 protected:
35 CLoader* pl;
36 CItemEltStruct* pitemes;
37 // CItemEltList* pitemelparents;
38 // CItemEltAtom* pitemeacomments;
39 std::vector< std::pair< CStringEx, CStringEx > > vsxparents;
40 CStringEx moldfilename;
42 public:
43 CItem();
44 virtual ~CItem();
46 void Clear();
47 void SetLoader( CLoader* const _pl );
48 void New( const CStringEx& _sxdfnfilename );
49 void Load( const CStringEx& _sxfilename );
50 void Load( const CStringEx& _sxfilename, const CStringEx _sxdate );
51 void Save( const CStringEx& _sxfilename );
52 bool Update();
54 // Convert CItem to a CForm (in is this)
55 void MakeForm (CForm &out);
56 // Convert CForm to CItem (out is this)
57 void MakeItem (CForm &in);
59 void SetCurrentValue( const unsigned int _index, const CStringEx s );
60 uint GetNbElt() const;
61 uint GetNbParents() const;
62 uint GetNbElt( const unsigned int _index ) const;
63 uint GetInfos( const unsigned int _index ) const;
64 CStringEx GetName( const unsigned int _index ) const;
65 CStringEx GetCurrentResult( const unsigned int _index ) const;
66 CStringEx GetCurrentValue( const unsigned int _index ) const;
67 CStringEx GetFormula( const unsigned int _index ) const;
68 bool IsEnum( const unsigned int _index ) const;
69 bool IsPredef( const unsigned int _index ) const;
70 bool CanEdit( const unsigned int _index ) const;
71 void GetListPredef( const unsigned int _index, std::vector< CStringEx >& _vsx ) const;
73 CItemElt* GetElt( const unsigned int _index ) const;
74 CItemElt* GetElt( const CStringEx _sxname ) const;
76 void AddList( const unsigned int _index ) const;
77 void DelListChild( const unsigned int _index ) const;
78 void VirtualSaveLoad();
80 void AddParent( const unsigned int _index = 0);
81 void DelParent( const unsigned int _index );
82 void ClearParents ();
83 CStringEx GetParent( const unsigned int _index ) const;
84 void SetParent( const unsigned int _index, const CStringEx _sx );
85 CStringEx GetActivity( const unsigned int _index ) const;
86 void SetActivity( const unsigned int _index, const CStringEx _sx );
89 } // NLGEORGES
91 #endif // NLGEORGES_ITEM_H