1 //
2 // VMime library (http://www.vmime.org)
3 // Copyright (C) 2002-2013 Vincent Richard <vincent@vmime.org>
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 3 of
8 // the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // Linking this library statically or dynamically with other modules is making
20 // a combined work based on this library.  Thus, the terms and conditions of
21 // the GNU General Public License cover the whole combination.
22 //
23 
24 #ifndef VMIME_PLATFORMS_WINDOWS_HANDLER_HPP_INCLUDED
25 #define VMIME_PLATFORMS_WINDOWS_HANDLER_HPP_INCLUDED
26 
27 
28 #include "vmime/config.hpp"
29 
30 
31 #if VMIME_PLATFORM_IS_WINDOWS
32 
33 
34 #include "vmime/platform.hpp"
35 
36 #if VMIME_HAVE_MESSAGING_FEATURES
37 	#include "vmime/platforms/windows/windowsSocket.hpp"
38 #endif
39 
40 #if VMIME_HAVE_FILESYSTEM_FEATURES
41 	 #include "vmime/platforms/windows/windowsFile.hpp"
42 #endif
43 
44 
45 namespace vmime {
46 namespace platforms {
47 namespace windows {
48 
49 
50 class VMIME_EXPORT windowsHandler : public vmime::platform::handler
51 {
52 public:
53 
54 	windowsHandler();
55 	~windowsHandler();
56 
57 	unsigned long getUnixTime() const;
58 
59 	const vmime::datetime getCurrentLocalTime() const;
60 
61 	const vmime::charset getLocalCharset() const;
62 
63 	const vmime::string getHostName() const;
64 
65 	unsigned int getProcessId() const;
66 	unsigned int getThreadId() const;
67 
68 #if VMIME_HAVE_MESSAGING_FEATURES
69 	shared_ptr <vmime::net::socketFactory> getSocketFactory();
70 #endif
71 
72 #if VMIME_HAVE_FILESYSTEM_FEATURES
73 	shared_ptr <vmime::utility::fileSystemFactory> getFileSystemFactory();
74 
75 	shared_ptr <vmime::utility::childProcessFactory> getChildProcessFactory();
76 #endif
77 
78 	void generateRandomBytes(unsigned char* buffer, const unsigned int count);
79 
80 	shared_ptr <utility::sync::criticalSection> createCriticalSection();
81 
82 private:
83 
84 #if VMIME_HAVE_MESSAGING_FEATURES
85 	shared_ptr <windowsSocketFactory> m_socketFactory;
86 #endif
87 
88 #if VMIME_HAVE_FILESYSTEM_FEATURES
89 	shared_ptr <windowsFileSystemFactory> m_fileSysFactory;
90 #endif
91 };
92 
93 
94 } // windows
95 } // platforms
96 } // vmime
97 
98 
99 #endif // VMIME_PLATFORM_IS_WINDOWS
100 
101 #endif // VMIME_PLATFORMS_WINDOWS_HANDLER_HPP_INCLUDED
102