OSDN Git Service

merge original branch.
[tortoisegit/TortoiseGitJp.git] / contrib / issue-tracker-plugins / ExampleAtlPlugin / Provider.h
1 #pragma once\r
2 #include "resource.h"       // main symbols\r
3 #include "ExampleAtlPlugin_i.h"\r
4 #include "..\inc\IBugTraqProvider_h.h"\r
5 \r
6 class ATL_NO_VTABLE CProvider :\r
7         public CComObjectRootEx<CComSingleThreadModel>,\r
8         public CComCoClass<CProvider, &CLSID_Provider>,\r
9         public IBugTraqProvider2\r
10 {\r
11 public:\r
12         CProvider();\r
13 \r
14 DECLARE_REGISTRY_RESOURCEID(IDR_PROVIDER)\r
15 \r
16 DECLARE_NOT_AGGREGATABLE(CProvider)\r
17 \r
18 BEGIN_COM_MAP(CProvider)\r
19         COM_INTERFACE_ENTRY(IBugTraqProvider)\r
20         COM_INTERFACE_ENTRY(IBugTraqProvider2)\r
21 END_COM_MAP()\r
22 \r
23         DECLARE_PROTECT_FINAL_CONSTRUCT()\r
24 \r
25         HRESULT FinalConstruct();\r
26         void FinalRelease();\r
27 \r
28 // IBugTraqProvider\r
29 public:\r
30     virtual HRESULT STDMETHODCALLTYPE ValidateParameters( \r
31         /* [in] */ HWND hParentWnd,\r
32         /* [in] */ BSTR parameters,\r
33         /* [retval][out] */ VARIANT_BOOL *valid);\r
34     \r
35     virtual HRESULT STDMETHODCALLTYPE GetLinkText( \r
36         /* [in] */ HWND hParentWnd,\r
37         /* [in] */ BSTR parameters,\r
38         /* [retval][out] */ BSTR *linkText);\r
39     \r
40     virtual HRESULT STDMETHODCALLTYPE GetCommitMessage( \r
41         /* [in] */ HWND hParentWnd,\r
42         /* [in] */ BSTR parameters,\r
43         /* [in] */ BSTR commonRoot,\r
44         /* [in] */ SAFEARRAY * pathList,\r
45         /* [in] */ BSTR originalMessage,\r
46         /* [retval][out] */ BSTR *newMessage);\r
47 \r
48         virtual HRESULT STDMETHODCALLTYPE GetCommitMessage2( \r
49                 /* [in] */ HWND hParentWnd,\r
50                 /* [in] */ BSTR parameters,\r
51                 /* [in] */ BSTR commonURL,\r
52                 /* [in] */ BSTR commonRoot,\r
53                 /* [in] */ SAFEARRAY * pathList,\r
54                 /* [in] */ BSTR originalMessage,\r
55                 /* [retval][out] */ BSTR *newMessage);\r
56 \r
57         virtual HRESULT STDMETHODCALLTYPE OnCommitFinished (\r
58                 /* [in] */ HWND hParentWnd,\r
59                 /* [in] */ BSTR commonRoot,\r
60                 /* [in] */ SAFEARRAY * pathList,\r
61                 /* [in] */ BSTR logMessage,\r
62                 /* [in] */ ULONG revision,\r
63                 /* [out, retval] */ BSTR * error);\r
64 \r
65         virtual HRESULT STDMETHODCALLTYPE HasOptions(\r
66                 /* [out, retval] */ VARIANT_BOOL *ret                   // Whether the provider provides options\r
67                 );\r
68 \r
69         // this method is called if HasOptions() returned true before.\r
70         // Use this to show a custom dialog so the user doesn't have to\r
71         // create the parameters string manually\r
72         virtual HRESULT STDMETHODCALLTYPE ShowOptionsDialog(\r
73                 /* [in] */ HWND hParentWnd,                                     // Parent window for the options dialog\r
74                 /* [in] */ BSTR parameters,\r
75                 /* [out, retval] */ BSTR * newparameters        // the parameters string\r
76                 );\r
77 \r
78 private:\r
79         typedef std::map< CString, CString > parameters_t;\r
80         parameters_t ParseParameters(BSTR parameters) const;\r
81 };\r
82 \r
83 OBJECT_ENTRY_AUTO(__uuidof(Provider), CProvider)\r