OSDN Git Service

Improve plugin system (#797)
[winmerge-jp/winmerge-jp.git] / Src / SelectPluginDlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 //    WinMerge:  an interactive diff/merge utility
3 //    Copyright (C) 1997-2000  Thingamahoochie Software
4 //    Author: Dean Grimm
5 //    SPDX-License-Identifier: GPL-2.0-or-later
6 /////////////////////////////////////////////////////////////////////////////
7 /**
8  *  @file SelectPluginDlg.h : 
9  *
10  *  @brief Declaration file for the dialog SelectUnpacker
11  */ 
12 #pragma once
13
14 #include <vector>
15 #include <memory>
16 #include "TrDialogs.h"
17 #include "SuperComboBox.h"
18 #include "UnicodeString.h"
19
20 /////////////////////////////////////////////////////////////////////////////
21 // CSelectPluginDlgDlg dialog
22
23 class PluginInfo;
24
25 class CSelectPluginDlg : public CTrDialog
26 {
27 private:
28 // Construction
29         void Initialize(bool unpacker);
30
31 public:
32 // Construction
33         CSelectPluginDlg(const String& pluginPipeline, const String& filename, bool unpacker = true, bool argumentRequired = false, CWnd* pParent = nullptr);
34         ~CSelectPluginDlg();
35
36         const String& CSelectPluginDlg::GetPluginPipeline() const { return m_strPluginPipeline; }
37
38 // Dialog Data
39         //{{AFX_DATA(CSelectPluginDlg)
40         enum { IDD = IDD_PLUGINS_SELECTPLUGIN };
41         CComboBox       m_cboPluginName;
42         bool    m_bNoExtensionCheck;
43         String  m_strDescription;
44         String  m_strExtensions;
45         String  m_strArguments;
46         String  m_strPluginPipeline;
47         CSuperComboBox m_ctlPluginPipeline;
48         
49         //}}AFX_DATA
50
51
52 // Overrides
53         // ClassWizard generated virtual function overrides
54         //{{AFX_VIRTUAL(CSelectPluginDlg)
55         protected:
56         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
57         //}}AFX_VIRTUAL
58
59 // Implementation
60 protected:
61         /// arrays for string describing the available plugins
62         std::map<String, std::vector<std::tuple<String, String, unsigned, PluginInfo *>>> m_Plugins;
63
64         // const data "no plugin"
65         std::unique_ptr<PluginInfo> noPlugin;
66         // const data "automatic plugin"
67         std::unique_ptr<PluginInfo> automaticPlugin;
68         bool m_bUnpacker;
69         bool m_bArgumentRequired;
70
71         // input value
72         String m_filteredFilenames;
73
74         void prepareListbox();
75
76         // Generated message map functions
77         //{{AFX_MSG(CSelectPluginDlg)
78         virtual void OnOK();
79         virtual BOOL OnInitDialog() override;
80         afx_msg void OnUnpackerAllowAll();
81         afx_msg void OnSelchangeUnpackerName();
82         afx_msg void OnClickedAddPipe();
83         afx_msg void OnChangePipeline();
84         //}}AFX_MSG
85         DECLARE_MESSAGE_MAP()
86 };