-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApplicationManager.h
More file actions
86 lines (68 loc) · 2.25 KB
/
ApplicationManager.h
File metadata and controls
86 lines (68 loc) · 2.25 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef APPLICATION_MANAGER_H
#define APPLICATION_MANAGER_H
#include "Defs.h"
#include "GUI\Output.h"
#include "GUI\Input.h"
#include "Actions\Action.h"
#include "Components\Component.h"
#include <fstream>
#include "..\Components\Pin.h"
#include "..\Components\OutputPin.h"
#include "..\Components\InputPin.h"
//Main class that manages everything in the application.
class ApplicationManager
{
enum { MaxCompCount = 200 }; //Max no of Components
private:
int CompCount; //Actual number of Components
Component* CompList[MaxCompCount]; //List of all Components (Array of pointers)
Output* OutputInterface; //pointer to the Output Clase Interface
Input* InputInterface; //pointer to the Input Clase Interface
Component* ComponentIsSelected;//pointer to component selected
GraphicsInfo r_GfxInfoUsed;//parameteres of selected component
Component* ComponenetIsCopied_Cut;//pointer to copied component
int CopyOrcut;//An integer to distinguish between Copied and Cut Componenet
int* CopyOrCut_ptr;//pointer to CopyOrCut integer
//ifstream inputFile;//
MODE mode;
int RecycleBinIndex;
Component* RecycleBin[MaxCompCount];
public:
public:
ApplicationManager(); //constructor
//Reads the required action from the user and returns the corresponding action type
ActionType GetUserAction();
//Creates an action and executes it
void ExecuteAction(ActionType);
void UpdateInterface(); //Redraws all the drawing window
void Refresh();
//Gets a pointer to Input / Output Object
Output* GetOutput();
Input* GetInput();
//Adds a new component to the list of components
void AddComponent(Component* pComp);
//Components getters
Component* getComponent(int, int, GraphicsInfo& r_GfxInfo);
Component* getComponentBy_ID(int );
//unselect functions
void UnselectOtherComponents(Component*);
void UnselectComponent();
void TurnOffComponents();
//Remove functions
void Remove(Component*&);
void Remove_Connections(OutputPin* = NULL, InputPin* = NULL);
//check if the component list is empty or not
bool IsCompListEmpty();
// Save components
void save(ofstream&);
//Load components
void load(ifstream&);
//Undo and Redo
void undofn();
void redofn();
void AddToRecycleBin(Component*);
void EmptyRecycleBin();
//destructor
~ApplicationManager();
};
#endif