-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGraphicItemBase.h
70 lines (55 loc) · 2.42 KB
/
GraphicItemBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
////////////////////////////////////////////////////////////////////////
// Copyright 2009-2018 NTESS. Under the terms
// of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// Copyright (c) 2009-2018, NTESS
// All rights reserved.
//
// Portions are copyright of other developers:
// See the file CONTRIBUTORS.TXT in the top level directory
// the distribution for more information.
//
// This file is part of the SST software package. For license
// information, see the LICENSE file in the top level directory of the
// distribution.
////////////////////////////////////////////////////////////////////////
#ifndef GRAPHICITEMBASE_H
#define GRAPHICITEMBASE_H
#include "GlobalIncludes.h"
// Forward declarations to allow compile
class ItemProperties;
////////////////////////////////////////////////////////////
class GraphicItemBase
{
public:
// Enumeration for Identifying the item type (NOTE: ITEMTYPE_END MUST ALWAYS BE LAST)
enum ItemType { ITEMTYPE_UNDEFINED, ITEMTYPE_COMPONENT, ITEMTYPE_PORT, ITEMTYPE_TEXT, ITEMTYPE_WIRE, ITEMTYPE_WIREHANDLE, ITEMTYPE_WIRELINESEGMENT, ITEMTYPE_END };
// Constructor / Destructor
GraphicItemBase(const ItemType itemType);
virtual ~GraphicItemBase();
// Return the Item Type
ItemType GetItemType() const {return m_ItemType;}
// Return the Item Properties
ItemProperties* GetItemProperties() {return m_Properties;}
// Properties Callback: Derived class should implement this function
// if it wants to receive notification of changes to a property
virtual void PropertyChanged(QString& PropName, QString& NewPropValue);
// Properties Callback: Derived class should implement this function
// if it wants to be notified that dynamic properties have changed and should
// be refreshed
virtual void DynamicPropertiesChanged(ItemProperties* ptrExistingProperties);
// Required Virtual Function to save Item Data
virtual void SaveData(QDataStream& DataStreamOut) = 0;
protected:
// Override this items properties with properties from somewhere else
void SetExistingPropertiesStructure(ItemProperties* ptrExistingProperties);
private:
// Functions to handle creation/ deletions of Properties structure
void CreatePropertiesStructure();
void DeletePropertiesStructure();
private:
ItemType m_ItemType;
ItemProperties* m_Properties;
};
#endif // GRAPHICITEMBASE_H