1 // 2 // Copyright (C) 2001-2013 Graeme Walker <graeme_walker@users.sourceforge.net> 3 // 4 // This program is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program. If not, see <http://www.gnu.org/licenses/>. 16 // === 17 /// 18 /// \file admin.h 19 /// 20 21 #ifndef G_MAIN_ADMIN_H 22 #define G_MAIN_ADMIN_H 23 24 #include "gdef.h" 25 #include "gsmtp.h" 26 #include "gsmtpclient.h" 27 #include "gsecrets.h" 28 #include "gadminserver.h" 29 #include "configuration.h" 30 #include <memory> 31 #include <string> 32 33 /// \namespace Main 34 namespace Main 35 { 36 class Admin ; 37 } 38 39 /// \class Main::Admin 40 /// A factory class for creating GSmtp::AdminServer objects. 41 /// 42 class Main::Admin 43 { 44 public: 45 static bool enabled() ; 46 ///< Returns true if newServer() is fully implemented. 47 48 static std::auto_ptr<GSmtp::AdminServer> newServer( const Configuration & , 49 GSmtp::MessageStore & store , const GSmtp::Client::Config & , 50 const GAuth::Secrets & client_secrets , const std::string & version_number ) ; 51 ///< A factory function for creating a new GSmtp::AdminServer 52 ///< instance on the heap. 53 54 static void notify( GSmtp::AdminServer & server , const std::string & , const std::string & , const std::string & ); 55 ///< Calls notify() on the given server. 56 57 static void report( const GSmtp::AdminServer & server ) ; 58 ///< Calls report() on the given server. 59 60 private: 61 Admin() ; // not implemented 62 } ; 63 64 #endif 65