diff --git a/include/transport/logger.h b/include/transport/logger.h new file mode 100644 index 0000000000000000000000000000000000000000..229e0f0ea81106d2db24c5ff4119e7d8ad78268a --- /dev/null +++ b/include/transport/logger.h @@ -0,0 +1,61 @@ +/** + * libtransport -- C++ library for easy XMPP Transports development + * + * Copyright (C) 2011, Jan Kaluza + * + * 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 02111-1301 USA + */ + +#pragma once + +#include +#include +#include "Swiften/Swiften.h" + +namespace Transport { + +struct UserInfo; +class User; +class UserManager; +class Component; +class StorageBackend; +class UserRegistration; + +class Logger +{ + public: + Logger(Component *component); + ~Logger(); + + void setStorageBackend(StorageBackend *storage); + void setUserRegistration(UserRegistration *userRegistration); + + private: + // Component + void handleConnected(); + void handleConnectionError(const Swift::ComponentError &error); + void handleXMLIn(const std::string &data); + void handleXMLOut(const std::string &data); + + // StorageBackend + void handleStorageError(const std::string &statement, const std::string &error); + + // UserRegistration + void handleUserRegistered(const UserInfo &user); + void handleUserUnregistered(const UserInfo &user); + void handleUserUpdated(const UserInfo &user); +}; + +}