fixup! [M120 Migration] Notify media device state to webbrowser
[platform/framework/web/chromium-efl.git] / base / file_version_info.h
1 // Copyright 2011 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_FILE_VERSION_INFO_H_
6 #define BASE_FILE_VERSION_INFO_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "build/build_config.h"
12 #include "base/base_export.h"
13
14 #if BUILDFLAG(IS_WIN)
15 #include <windows.h>
16 #endif
17
18 namespace base {
19 class FilePath;
20 }
21
22 // Provides an interface for accessing the version information for a file. This
23 // is the information you access when you select a file in the Windows Explorer,
24 // right-click select Properties, then click the Version tab, and on the Mac
25 // when you select a file in the Finder and do a Get Info.
26 //
27 // This list of properties is straight out of Win32's VerQueryValue
28 // <http://msdn.microsoft.com/en-us/library/ms647464.aspx> and the Mac
29 // version returns values from the Info.plist as appropriate. TODO(avi): make
30 // this a less-obvious Windows-ism.
31
32 class BASE_EXPORT FileVersionInfo {
33  public:
34   virtual ~FileVersionInfo() {}
35 #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)
36   // Creates a FileVersionInfo for the specified path. Returns nullptr if
37   // something goes wrong (typically the file does not exit or cannot be
38   // opened).
39   static std::unique_ptr<FileVersionInfo> CreateFileVersionInfo(
40       const base::FilePath& file_path);
41 #endif  // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)
42
43 #if BUILDFLAG(IS_WIN)
44   // Creates a FileVersionInfo for the specified module. Returns nullptr in
45   // case of error.
46   static std::unique_ptr<FileVersionInfo> CreateFileVersionInfoForModule(
47       HMODULE module);
48 #else
49   // Creates a FileVersionInfo for the current module. Returns nullptr in case
50   // of error.
51   static std::unique_ptr<FileVersionInfo>
52   CreateFileVersionInfoForCurrentModule();
53 #endif  // BUILDFLAG(IS_WIN)
54
55   // Accessors to the different version properties.
56   // Returns an empty string if the property is not found.
57   virtual std::u16string company_name() = 0;
58   virtual std::u16string company_short_name() = 0;
59   virtual std::u16string product_name() = 0;
60   virtual std::u16string product_short_name() = 0;
61   virtual std::u16string internal_name() = 0;
62   virtual std::u16string product_version() = 0;
63   virtual std::u16string special_build() = 0;
64   virtual std::u16string original_filename() = 0;
65   virtual std::u16string file_description() = 0;
66   virtual std::u16string file_version() = 0;
67 };
68
69 #endif  // BASE_FILE_VERSION_INFO_H_