OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [common/] [win32/] [ConfigItem.h] - Blame information for rev 790

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
//===========================================================================
23
//#####DESCRIPTIONBEGIN####
24
//
25
// Author(s):   sdf
26
// Contact(s):  sdf
27
// Date:                1998/08/11
28
// Version:             0.01
29
// Purpose:     
30
// Description: The Configuration item class
31
// Requires:    
32
// Provides:    
33
// See also:    
34
// Known bugs:  
35
// Usage:       
36
//
37
//####DESCRIPTIONEND####
38
//
39
//===========================================================================
40
 
41
#ifndef _TREEITEM_H
42
#define _TREEITEM_H
43
#include "stdafx.h"
44
#include "FileName.h"
45
 
46
#define INCLUDEFILE <cdl.hxx>
47
#include "IncludeSTL.h"
48
 
49
class CCdlInterface;
50
class CdlGoalExpressionBody;
51
class CdlTransactionBody;
52
 
53
class CConfigItem {
54
        friend class CConfigToolDoc;
55
        friend class CCdlInterface;
56
public:
57
        CConfigItem(CConfigItem *pParent, CdlUserVisible CdlItem);
58
        virtual ~CConfigItem();
59
 
60
  bool ChangeVersion (const CString &strVersion);
61
        bool Unload();
62
  CdlPackage GetOwnerPackage() const { return GetCdlItem()?(dynamic_cast<CdlPackage> (GetCdlItem()->get_owner ())):NULL; }
63
  CdlValuable GetCdlValuable() const { return dynamic_cast<CdlValuable> (GetCdlItem()); }
64
        bool ViewURL();
65
        bool ViewHeader();
66
        bool HasRadio () const;
67
        bool HasBool () const;
68
        int  EvalEnumStrings (CStringArray &arEnumStrings) const;
69
        bool IsDescendantOf (CConfigItem *pAncestor);
70
        void SetHItem (HTREEITEM hItem) { m_hItem=hItem; };
71
        CString ItemNameOrMacro() const;
72
        CConfigItem * NextRadio() const;
73
        bool CanSetValue (ItemIntegerType nValue) const;
74
        enum TreeItemType { None, Integer, Enum, String, Double, MaxTreeItemType };
75
 
76
        static LPCTSTR TreeItemTypeImage[MaxTreeItemType + 1];
77
 
78
        ItemIntegerType Value() const;
79
        bool HasModifiedChildren() const;
80
        bool IsEnabled() const;
81
        CConfigItem *FirstRadio() const;
82
        CString GetURL () const;
83
        const CFileName FileName () const;
84
        const CString StringValue (CdlValueSource source = CdlValueSource_Current) const;
85
  const CString StringValue(WhereType where) const;
86
        const double DoubleValue (CdlValueSource source = CdlValueSource_Current) const;
87
        void DumpItem();
88
 
89
        // Access functions
90
        ItemIntegerType DefaultValue() const;
91
        const CString StringDefaultValue() const { return StringValue (CdlValueSource_Default); }
92
        const double DoubleDefaultValue () const { return DoubleValue (CdlValueSource_Default); }
93
  const CString Name() const { return GetCdlItem()?GetCdlItem()->get_display ().c_str ():CString(_T("Configuration")); }
94
        TreeItemType Type() const { return m_Type; }
95
        CConfigItem *Parent() const;
96
        CConfigItem *FirstChild() const;
97
        CConfigItem *NextSibling() const;
98
        bool  Modified() const;
99
        const CString Desc() const { return m_strDesc; }
100
  const CString Macro() const { return GetCdlItem()?GetCdlItem()->get_name().c_str():CString();  }
101
        CdlUserVisible GetCdlItem () const { return m_CdlItem; }
102
        HTREEITEM HItem() const { return m_hItem; }
103
        bool IsPackage () const { return NULL!=dynamic_cast<CdlPackage> (GetCdlItem()); }
104
 
105
protected:
106
        bool SetValue (LPCTSTR pszValue, CdlTransaction transaction=NULL);
107
        bool SetValue (ItemIntegerType nValue, CdlTransaction transaction=NULL);
108
        bool SetValue (double dValue, CdlTransaction transaction=NULL);
109
        bool SetEnabled (bool bEnabled, CdlTransaction transaction=NULL);
110
 
111
        HTREEITEM m_hItem;
112
        CString m_strDesc; // Short description
113
        TreeItemType m_Type;
114
        CdlUserVisible m_CdlItem;
115
};
116
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.