1
0
This repository has been archived on 2025-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
Files
siadrive/SiaDrive/SiaDriveDlg.h
2017-02-11 03:13:46 -06:00

77 lines
2.1 KiB
C++

// SiaDriveDlg.h : header file
//
#pragma once
#include <SiaApi.h>
#include "SiaDriveConfig.h"
using namespace Sia::Api;
// CSiaDriveDlg dialog
class CSiaDriveDlg : public CDHtmlDialog
{
// Construction
public:
CSiaDriveDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_SIADRIVE_DIALOG, IDH = IDR_HTML_SIADRIVE_DIALOG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
HRESULT OnButtonOK(IHTMLElement *pElement);
HRESULT OnButtonCancel(IHTMLElement *pElement);
HRESULT OnButtonCreateWallet(IHTMLElement* pElement);
HRESULT OnButtonConfirmSeed(IHTMLElement* pElement);
HRESULT OnButtonUnlockWallet(IHTMLElement* pElement);
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
virtual void OnDocumentComplete(LPDISPATCH pDisp, LPCTSTR szUrl);
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnTimer(UINT_PTR nIDEvent);
DECLARE_MESSAGE_MAP()
DECLARE_DHTML_EVENT_MAP()
virtual BOOL PreTranslateMessage(MSG* pMsg) override;
virtual HRESULT WINAPI TranslateAccelerator(MSG *message, const GUID *, DWORD) override;
private:
void DisplayCreateWallet();
void DisplaySeedCreated(const String& seed);
bool UpdateSiaInfo();
void DisplayUnlockWallet();
void ConfigureWallet();
void RemoveCreateWalletItems();
void RemoveDomNodeById(const String& id);
void SetMainWindow(const String& name);
bool UpdateUi(const bool& refresh = true);
HRESULT GetDomNodeAndElementById(const String& id, CComPtr<IHTMLDOMNode>& node, CComPtr<IHTMLElement>& elem);
HRESULT GetDomNodeById(const String& id, CComPtr<IHTMLDOMNode>& node);
private:
CSiaDriveConfig _siaConfig;
CSiaApi _siaApi;
CString _serverVersion;
CString _clientVersion;
CString _walletBalanceConfirmed;
CString _walletBalanceTotal;
CString _walletBalanceUnconfirmed;
CString _walletCreatedSeed;
CString _walletAddress;
CString _unlockWalletPwd;
bool _connected = false;
bool _seedCreation = false;
static const UINT IDT_UPDATE = 1;
static const std::uint8_t WALLET_TAB = 0;
};