📄 teamviewerinfo.h
字号:
// Copyright (C) 2006 Teamviewer GmbH. All Rights Reserved.
//
// This file is part of the TeamViewer system.
//
// TeamViewer 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
//
// If the source code for TeamViewer is not available from the place
// whence you received this file, check http://www.teamviewer.com
#ifndef TEAMVIEWERINFO_H__
#define TEAMVIEWERINFO_H__
#include "VSocket.h"
#include "vncclient.h"
#include "..\..\vncviewer\vncviewerapp.h"
typedef std::vector<CARD16> ResultVector;
enum ObjectType { TI_VNCCLIENT, TI_CLIENTCONNECTION };
class TeamviewerInfo
{
private:
char *buffer; // local buffer which accumulates the TeamviewerMessages to be sent
int infolen; // total length of the messages
void *object; // object the socket is in
ObjectType objecttype; // and its type
bool readfunc(char* buf, int len); // read from socket
bool writefunc(char* buf, int len); // write to socket
void sendTVMessage(CARD16 messageID, CARD32 messageLen, char* msg); // prepare a teamviewer-message
std::map<CARD16,std::string> partnerinfo; // map contains partners tv-infos
static std::map<CARD16,std::string> localinfo; // map contains local tv-infos
void setPartnerInfo(CARD16 msgid, std::string info) { partnerinfo[msgid] = info; }
public:
TeamviewerInfo(ObjectType ot, void *o);
~TeamviewerInfo(void);
bool partnerIsTeamviewer; // true if partner knows TeamviewerInfo
void FinishTeamviewerInfo(); // send all messages
void SendCommand(CARD16 msgid, string value);
void SendInfo(CARD16 msgid, std::string value);
void SendInfo(CARD16 msgid);
void RequestInfo(CARD16 msgid) { sendTVMessage(tvRequest(msgid), 0, NULL); } // request info from partner
ResultVector ReadTeamviewerInfo(int offset); // read incoming messages
std::string getPartnerInfo(CARD16 msgid) { return partnerinfo[msgid]; }
static std::string getLocalInfo(CARD16 msgid) { return localinfo[msgid]; }
static void setLocalInfo(CARD16 msgid, std::string info) { localinfo[msgid] = info; }
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -