-
Notifications
You must be signed in to change notification settings - Fork 2
/
TvnAssistApp.h
108 lines (94 loc) · 3.21 KB
/
TvnAssistApp.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Copyright (C) 2009,2010,2011,2012 GlavSoft LLC.
// All rights reserved.
//
//-------------------------------------------------------------------------
// This file is part of the TightVNC software. Please visit our Web site:
//
// http://www.tightvnc.com/
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//-------------------------------------------------------------------------
//
#ifndef _TVN_ASSIST_SERVER_APPLICATION_H_
#define _TVN_ASSIST_SERVER_APPLICATION_H_
#include "util/CommonHeader.h"
#include "util/winhdr.h"
#include "win-system/WindowsApplication.h"
#include "TvnAssistServer.h"
#include "tvnserver-app/TvnServerListener.h"
#include "tvnserver-app/WsConfigRunner.h"
#include "log-writer/FileLogger.h"
#include "tvnserver-app/LogInitListener.h"
/**
* Windows TightVNC server application.
* Used for running TightVNC server as single windows application.
*/
class TvnAssistApp : public WindowsApplication,
public TvnServerListener,
private LogInitListener
{
public:
/**
* Creates TightVNC server application instance.
* @param hInstance HINSTANCE of application.
* @param commaneLine command line string.
*/
TvnAssistApp(HINSTANCE hInstance,
const TCHAR* windowClassName,
const TCHAR* commandLine,
NewConnectionEvents* newConnectionEvents);
/**
* Deletes TightVNC server application instance.
*/
virtual ~TvnAssistApp();
/**
* Runs TightVNC server windows application.
*
* Makes several things:
* 1) Starts TigthVNC server.
* 2) Starts TvnControl application.
* 3) Enters main windows message loop.
* 4) Stops TigthVNC server.
*
* @return application exit code.
*/
virtual int run();
/**
* Inherited from TvnServerListener abstact class.
*
* Shutdowns WindowsApplication.
*/
virtual void onTvnServerShutdown();
private:
// This is a callback function that calls when the log can be initialized.
virtual void onLogInit(const TCHAR* logDir, const TCHAR* fileName, unsigned char logLevel);
// This is a callback function that calls when log properties have changed.
virtual void onChangeLogProps(const TCHAR* newLogDir, unsigned char newLevel);
FileLogger m_fileLogger;
/**
* Command line string.
*/
StringStorage m_commandLine;
/**
* TightVNC server.
*/
TvnAssistServer* m_tvnServer;
/**
* TvnControl application watcher.
*/
WsConfigRunner* m_tvnControlRunner;
NewConnectionEvents* m_newConnectionEvents;
};
#endif