-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCardPresenter.h
More file actions
46 lines (39 loc) · 1.06 KB
/
Copy pathCardPresenter.h
File metadata and controls
46 lines (39 loc) · 1.06 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
#pragma once
#include "CardModel.h"
#include "Reading.h"
#include <Path.h>
#include <String.h>
#include <future>
#include <thread>
#include <vector>
class CardModel;
class CardView;
class BView;
enum SpreadType { THREE_CARD, TREE_OF_LIFE };
class CardPresenter {
public:
// Constructor now takes dependencies
CardPresenter(CardModel* model, CardView* view);
~CardPresenter();
void NewReading();
void OnFrameResized();
void SaveFile(const BPath& path);
void OpenFile(const BPath& path);
BString GetCurrentReading() const { return fCurrentReading; }
BView* GetView();
void SetView(CardView* view); // New method to set the view
BString GetAPIKey();
void SetAPIKey(const BString& apiKey);
void SetSpread(const BString& spreadName);
void SetFontSize(float fontSize);
private:
void LoadThreeCardSpread();
void LoadTreeOfLifeSpread();
void SaveReadingToFile(const std::vector<CardInfo>& cards, const BString& reading);
CardModel* fModel;
CardView* fView;
std::future<void> fReadingFuture;
Reading* fReading;
BString fCurrentReading;
SpreadType fSpread;
};