From 8d93246be88fdcdef666c229fa0d204b160ba876 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 21 Mar 2025 18:26:05 +0300 Subject: skeleton for Teams --- protocols/Teams/CMakeLists.txt | 6 +++ protocols/Teams/Teams.vcxproj | 51 ++++++++++++++++++ protocols/Teams/Teams.vcxproj.filters | 34 ++++++++++++ protocols/Teams/res/Resource.rc | 97 ++++++++++++++++++++++++++++++++++ protocols/Teams/res/teams.ico | Bin 0 -> 1150 bytes protocols/Teams/res/version.rc | 9 ++++ protocols/Teams/src/main.cpp | 43 +++++++++++++++ protocols/Teams/src/proto.h | 19 +++++++ protocols/Teams/src/resource.h | 16 ++++++ protocols/Teams/src/stdafx.cxx | 18 +++++++ protocols/Teams/src/stdafx.h | 50 ++++++++++++++++++ protocols/Teams/src/teams_proto.cpp | 10 ++++ protocols/Teams/src/version.h | 13 +++++ 13 files changed, 366 insertions(+) create mode 100644 protocols/Teams/CMakeLists.txt create mode 100644 protocols/Teams/Teams.vcxproj create mode 100644 protocols/Teams/Teams.vcxproj.filters create mode 100644 protocols/Teams/res/Resource.rc create mode 100644 protocols/Teams/res/teams.ico create mode 100644 protocols/Teams/res/version.rc create mode 100644 protocols/Teams/src/main.cpp create mode 100644 protocols/Teams/src/proto.h create mode 100644 protocols/Teams/src/resource.h create mode 100644 protocols/Teams/src/stdafx.cxx create mode 100644 protocols/Teams/src/stdafx.h create mode 100644 protocols/Teams/src/teams_proto.cpp create mode 100644 protocols/Teams/src/version.h diff --git a/protocols/Teams/CMakeLists.txt b/protocols/Teams/CMakeLists.txt new file mode 100644 index 0000000000..32662a7b47 --- /dev/null +++ b/protocols/Teams/CMakeLists.txt @@ -0,0 +1,6 @@ +file(GLOB SOURCES "src/*.h" "src/api/*.h" "src/*.cpp" "res/*.rc") +set(TARGET Teams) +include(${CMAKE_SOURCE_DIR}/cmake/plugin.cmake) +target_link_libraries(${TARGET}) +set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS "/std:c++17") +add_subdirectory(proto_teams) \ No newline at end of file diff --git a/protocols/Teams/Teams.vcxproj b/protocols/Teams/Teams.vcxproj new file mode 100644 index 0000000000..83054e7087 --- /dev/null +++ b/protocols/Teams/Teams.vcxproj @@ -0,0 +1,51 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {DCD56CEC-C61B-4275-A010-8C65C5B48815} + Teams + + + + + + + + Create + + + + + + + + + + + + + stdcpp17 + .;%(AdditionalIncludeDirectories) + + + libcrypto.lib;libssl.lib;%(AdditionalDependencies) + + + \ No newline at end of file diff --git a/protocols/Teams/Teams.vcxproj.filters b/protocols/Teams/Teams.vcxproj.filters new file mode 100644 index 0000000000..8f2a1e1f95 --- /dev/null +++ b/protocols/Teams/Teams.vcxproj.filters @@ -0,0 +1,34 @@ + + + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + + \ No newline at end of file diff --git a/protocols/Teams/res/Resource.rc b/protocols/Teams/res/Resource.rc new file mode 100644 index 0000000000..389d09e189 --- /dev/null +++ b/protocols/Teams/res/Resource.rc @@ -0,0 +1,97 @@ +// Microsoft Visual C++ generated resource script. +// +#include "..\src\resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Neutral (Default) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD) +LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT +#pragma code_page(1251) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "..\\src\\resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // Neutral (Default) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Russian (Russia) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +#pragma code_page(1251) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_TEAMS ICON "teams.ico" + +#endif // Russian (Russia) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (Neutral) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +#endif // English (Neutral) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/protocols/Teams/res/teams.ico b/protocols/Teams/res/teams.ico new file mode 100644 index 0000000000..76e8549214 Binary files /dev/null and b/protocols/Teams/res/teams.ico differ diff --git a/protocols/Teams/res/version.rc b/protocols/Teams/res/version.rc new file mode 100644 index 0000000000..5a5ddd63ed --- /dev/null +++ b/protocols/Teams/res/version.rc @@ -0,0 +1,9 @@ +// Microsoft Visual C++ generated resource script. +// +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + +#include "..\src\version.h" + +#include "..\..\build\Version.rc" diff --git a/protocols/Teams/src/main.cpp b/protocols/Teams/src/main.cpp new file mode 100644 index 0000000000..5301dc7ecf --- /dev/null +++ b/protocols/Teams/src/main.cpp @@ -0,0 +1,43 @@ +#include "stdafx.h" + +CMPlugin g_plugin; + +HANDLE hExtraXStatus; + +///////////////////////////////////////////////////////////////////////////////////////// + +PLUGININFOEX pluginInfoEx = +{ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + // {DCD56CEC-C61B-4275-A010-8C65C5B48815} + { 0xDCD56CEC, 0xC61B, 0x4275, { 0xa0, 0x10, 0x8c, 0x65, 0xc5, 0x84, 0x88, 0x15 }} +}; + +CMPlugin::CMPlugin() : + ACCPROTOPLUGIN("Teams", pluginInfoEx) +{ + SetUniqueId("id"); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; + +///////////////////////////////////////////////////////////////////////////////////////// + +static IconItem iconList[] = { + { LPGEN("Protocol icon"), "main", IDI_TEAMS }, +}; + +int CMPlugin::Load() +{ + g_plugin.registerIcon("Protocols/" MODULENAME, iconList, MODULENAME); + return 0; +} diff --git a/protocols/Teams/src/proto.h b/protocols/Teams/src/proto.h new file mode 100644 index 0000000000..d9001e2402 --- /dev/null +++ b/protocols/Teams/src/proto.h @@ -0,0 +1,19 @@ +struct HttpRequest : public MTHttpRequest +{ + HttpRequest(int iRequestType, const char *pszUrl); +}; + +class CTeamsProto : public PROTO +{ +public: + // constructor + CTeamsProto(const char *protoName, const wchar_t *userName); + ~CTeamsProto(); +}; + +struct CMPlugin : public ACCPROTOPLUGIN +{ + CMPlugin(); + + int Load() override; +}; diff --git a/protocols/Teams/src/resource.h b/protocols/Teams/src/resource.h new file mode 100644 index 0000000000..aaf7906399 --- /dev/null +++ b/protocols/Teams/src/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by W:\miranda-ng\protocols\Steam\res\Resource.rc +// +#define IDI_TEAMS 100 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 127 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1087 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/protocols/Teams/src/stdafx.cxx b/protocols/Teams/src/stdafx.cxx new file mode 100644 index 0000000000..4a1e1f0e70 --- /dev/null +++ b/protocols/Teams/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org) + +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 version 2 +of the License. + +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, see . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/protocols/Teams/src/stdafx.h b/protocols/Teams/src/stdafx.h new file mode 100644 index 0000000000..9ef202a899 --- /dev/null +++ b/protocols/Teams/src/stdafx.h @@ -0,0 +1,50 @@ +#ifndef _COMMON_H_ +#define _COMMON_H_ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "resource.h" +#include "version.h" + +#define MODULENAME "Teams" + +class CTeamsProto; + +#include "proto.h" + +#endif //_COMMON_H_ \ No newline at end of file diff --git a/protocols/Teams/src/teams_proto.cpp b/protocols/Teams/src/teams_proto.cpp new file mode 100644 index 0000000000..2e6eb83e5c --- /dev/null +++ b/protocols/Teams/src/teams_proto.cpp @@ -0,0 +1,10 @@ +#include "stdafx.h" + +CTeamsProto::CTeamsProto(const char *protoName, const wchar_t *userName) : + PROTO(protoName, userName) +{ +} + +CTeamsProto::~CTeamsProto() +{ +} diff --git a/protocols/Teams/src/version.h b/protocols/Teams/src/version.h new file mode 100644 index 0000000000..711a86277e --- /dev/null +++ b/protocols/Teams/src/version.h @@ -0,0 +1,13 @@ +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 96 +#define __RELEASE_NUM 6 +#define __BUILD_NUM 1 + +#include + +#define __PLUGIN_NAME "Teams protocol" +#define __FILENAME "Teams.dll" +#define __DESCRIPTION "Teams protocol support for Miranda NG." +#define __AUTHOR "Miranda NG team" +#define __AUTHORWEB "https://miranda-ng.org/p/Teams" +#define __COPYRIGHT "© 2025 Miranda NG team" -- cgit v1.2.3