File: GUI_Sponsor.h

package info (click to toggle)
mediainfo 26.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,912 kB
  • sloc: cpp: 19,090; objc: 3,102; xml: 1,428; sh: 1,328; python: 263; makefile: 212
file content (80 lines) | stat: -rw-r--r-- 2,846 bytes parent folder | download
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
/*  Copyright (c) MediaArea.net SARL. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license that can
 *  be found in the License.html file in the root of the source tree.
 */

//---------------------------------------------------------------------------
#ifndef GUI_SponsorH
#define GUI_SponsorH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Forms.hpp>
//---------------------------------------------------------------------------
#include <ZenLib/Ztring.h>
#include <ZenLib/OS_Utils.h>
//---------------------------------------------------------------------------

class TMainF;
class TSponsorFrame;

//***************************************************************************
// DownloadBannerThread Class
//***************************************************************************
class DownloadBannerThread :public TThread
{
public:
    __fastcall DownloadBannerThread(TSponsorFrame* Parent, ZenLib::Ztring Url, ZenLib::Ztring Dst);

    void __fastcall Execute();
    void __fastcall Error();
    void __fastcall Finalize();

    void __fastcall UpdateDownloadProgress();
    void __fastcall OnReceiveData(TObject* const Sender, __int64 AContentLength, __int64 AReadCount, bool& Abort);
    void __fastcall OnRequestError(TObject* const Sender, System::UnicodeString Message) { Synchronize(&Error); };

private:
    TSponsorFrame* Parent;
    float Progress;
    ZenLib::Ztring Url;
    ZenLib::Ztring Dst;
};

//***************************************************************************
// TSponsorFrame Class
//***************************************************************************
class TSponsorFrame : public TFrame
{
__published:
    TButton *CloseButton;
    TImage *BannerImage;
    TPanel *RightPanel;
    void __fastcall CloseButtonClick(TObject *Sender);
    void __fastcall BannerImageClick(TObject *Sender);
    void __fastcall OnResize(TObject *Sender);
    void __fastcall BannerImageMouseInter(TObject *Sender);
    void __fastcall BannerImageMouseLeave(TObject *Sender);

public:
    __fastcall TSponsorFrame(TComponent* Owner, TMainF* Main);

    void __fastcall Init();
    void __fastcall Translate();
    void __fastcall Error();
    void __fastcall Finalize();

private:
    TMainF* Main;
    ZenLib::Ztring SourceURL;
    ZenLib::Ztring BannerPath;
    ZenLib::Ztring BannerClickUrl;
    DownloadBannerThread* DownloadThread;
};
//---------------------------------------------------------------------------
extern PACKAGE TSponsorFrame *SponsorFrame;
//---------------------------------------------------------------------------
#endif